/** * Sorts the data models. * * @param input the models that will be sorted * @param output the output of the sorting * @param external the external dependencies * @throws DataStructureModelException the data structure model exception */ public static void sort(Map<String, DataStructureModel> input, List<String> output, List<String> external) throws DataStructureModelException { List<String> processing = new ArrayList<String>(); for (Entry<String, DataStructureModel> entry : input.entrySet()) { DataStructureModel dataStructureModel = entry.getValue(); followDependencies(input, output, external, processing, dataStructureModel); String name = dataStructureModel.getName(); if (!output.contains(name)) { output.add(name); } } }
List<String> external = new ArrayList<String>(); try { DataStructureTopologicalSorter.sort(DATA_STRUCTURE_MODELS, sorted, external);
followDependencies(input, output, external, processing, dependentModel); output.add(dependencyName);