import org.opendaylight.yangtools.yang.model.api.UsesNode;
public class GroupingDefinitionDependencySort {
-
/**
- * Sorts set <code>groupingDefinitions</code> according to the mutual
- * dependencies.<br>
- *
- * Elements of <code>groupingDefinitions</code> are firstly transformed to
- * {@link TopologicalSort.Node Node} interfaces and then are sorted by
- * {@link TopologicalSort#sort(Set) sort()} method of <code>TopologicalSort</code>.<br>
- * <br>
+ * Sorts set <code>groupingDefinitions</code> according to the mutual dependencies.<br>
+ * Elements of <code>groupingDefinitions</code> are firstly transformed to {@link TopologicalSort.Node Node}
+ * interfaces and then are sorted by {@link TopologicalSort#sort(Set) sort()} method
+ * of <code>TopologicalSort</code>.<br>
*
* <i>Definition of dependency relation:<br>
* The first <code>GroupingDefinition</code> object (in this context)
* {@link org.opendaylight.yangtools.yang.model.api.DataNodeContainer#getUses()
* getUses} method) reference to the second one.</i>
*
- * @param groupingDefinitions
- * set of grouping definition which should be sorted according to
- * mutual dependencies
- * @return list of grouping definitiond which are sorted by mutual
- * dependencies
- * @throws IllegalArgumentException
- * if <code>groupingDefinitions</code>
+ * @param groupingDefinitions set of grouping definition which should be sorted according to mutual dependencies
+ * @return list of grouping definitiond which are sorted by mutual dependencies
+ * @throws IllegalArgumentException if <code>groupingDefinitions</code>
*
*/
public List<GroupingDefinition> sort(final Collection<GroupingDefinition> groupingDefinitions) {
if (groupingDefinitions == null) {
- throw new IllegalArgumentException("Set of Type Definitions " + "cannot be NULL!");
+ throw new IllegalArgumentException("Set of Type Definitions cannot be NULL!");
}
final List<GroupingDefinition> resultGroupingDefinitions = new ArrayList<>();
resultGroupingDefinitions.add((GroupingDefinition) nodeWrappedType.getWrappedType());
}
return resultGroupingDefinitions;
-
}
/**
- * Wraps every grouping definition to node type and adds to every node
- * information about dependencies.
- *
- * The map with mapping from schema path (represents grouping definition) to
- * node is created. For every created node (next <i>nodeFrom</i>) is for its
- * wrapped grouping definition passed the set of its <i>uses nodes</i>
- * through. For every uses node is found its wrapping node (next as
- * <i>nodeTo</i>). This dependency relationship between nodeFrom and all
- * found nodesTo is modeled with creating of one edge from nodeFrom to
- * nodeTo.
- *
- *
- * @param groupingDefinitions
- * set of goruping definition which will be wrapped to nodes
+ * Wraps every grouping definition to node type and adds to every node information about dependencies. The map
+ * with mapping from schema path (represents grouping definition) to node is created. For every created node
+ * (next <i>nodeFrom</i>) is for its wrapped grouping definition passed the set of its <i>uses nodes</i> through.
+ * For every uses node is found its wrapping node (next as <i>nodeTo</i>). This dependency relationship between
+ * nodeFrom and all found nodesTo is modeled with creating of one edge from nodeFrom to nodeTo.
*
+ * @param groupingDefinitions set of goruping definition which will be wrapped to nodes
* @return set of nodes where every one contains wrapped grouping definition
*/
private Set<Node> groupingDefinitionsToNodes(final Collection<GroupingDefinition> groupingDefinitions) {
}
/**
- * Returns the set of the uses nodes which are get from uses in
- * <code>container</code>, from uses in groupings inside
- * <code>container</code> and from uses inside child nodes of the
- * <code>container</code>.
+ * Returns the set of the uses nodes which are get from uses in <code>container</code>, from uses in groupings
+ * inside <code>container</code> and from uses inside child nodes of the <code>container</code>.
*
- * @param container
- * data node container which can contain some uses of grouping
+ * @param container data node container which can contain some uses of grouping
* @return set of uses nodes which were find in <code>container</code>.
*/
private Set<UsesNode> getAllUsesNodes(final DataNodeContainer container) {