X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fgraph%2Fcomponent%2FComponentGraph.java;h=1d6501ded4a29d2129e97565a53513a8201d287d;hb=8de36ff0206c996baf3ee4adc3e2293b12ff5f39;hp=5c77217fe1fb9c198cbcd74b8ee1a449f9f2dd66;hpb=89c06d4d52b46c154128c97d6e758fa1f4fc7a6e;p=utils diff --git a/system/general/src/main/java/org/wamblee/system/graph/component/ComponentGraph.java b/system/general/src/main/java/org/wamblee/system/graph/component/ComponentGraph.java index 5c77217f..1d6501de 100644 --- a/system/general/src/main/java/org/wamblee/system/graph/component/ComponentGraph.java +++ b/system/general/src/main/java/org/wamblee/system/graph/component/ComponentGraph.java @@ -29,37 +29,32 @@ import org.wamblee.system.graph.Node; import java.util.ArrayList; import java.util.List; - /** - * Represents a component graph and provides the bridge from the component - * model to a graph model. The graph model is easier to work with to implement - * specific actions and validations than the component model. + * Represents a component graph and provides the bridge from the component model + * to a graph model. The graph model is easier to work with to implement + * specific actions and validations than the component model. */ public class ComponentGraph extends Graph { - /** - * DOCUMENT ME! - */ private boolean isLinked; - /** - * DOCUMENT ME! - */ private CompositeEdgeFilter edgeFilter; -/** - * Constructs an empty component graph. + /** + * Constructs an empty component graph. */ public ComponentGraph() { - isLinked = false; - edgeFilter = new CompositeEdgeFilter(); + isLinked = false; + edgeFilter = new CompositeEdgeFilter(); } /** - * Adds an externally required interface of a container. This - * should be called before any components of the container are added. - * - * @param aComponent Component requiring the interface. - * @param aInterface Required interface. + * Adds an externally required interface of a container. This should be + * called before any components of the container are added. + * + * @param aComponent + * Component requiring the interface. + * @param aInterface + * Required interface. */ public void addRequiredInterface(Component aComponent, RequiredInterface aInterface) { @@ -67,11 +62,13 @@ public class ComponentGraph extends Graph { } /** - * Adds an externally provided interface of a container. This - * should be called after all components of the container have been added. - * - * @param aComponent Component providing the interface. - * @param aInterface Provided interface. + * Adds an externally provided interface of a container. This should be + * called after all components of the container have been added. + * + * @param aComponent + * Component providing the interface. + * @param aInterface + * Provided interface. */ public void addProvidedInterface(Component aComponent, ProvidedInterface aInterface) { @@ -91,8 +88,8 @@ public class ComponentGraph extends Graph { } /** - * Links provided and required interfaces together in the component - * model based on the graph model. + * Links provided and required interfaces together in the component model + * based on the graph model. */ public void link() { if (isLinked) { @@ -104,21 +101,21 @@ public class ComponentGraph extends Graph { } /** - * Finds a list of mappings of external provided interface to - * internal provided interface. - * + * Finds a list of mappings of external provided interface to internal + * provided interface. + * * @return List of pairs of external to internal interface. */ public List> findExternalProvidedInterfaceMapping() { List> result = new ArrayList>(); for (Edge edge : getEdges()) { - if (edge.getFrom() instanceof ExternalProvidedInterfaceNode - && edge.getTo() instanceof ProvidedInterfaceNode) { + if (edge.getFrom() instanceof ExternalProvidedInterfaceNode && + edge.getTo() instanceof ProvidedInterfaceNode) { result.add(new Pair( - ((ExternalProvidedInterfaceNode) edge.getFrom()) - .getProvided(), - ((ProvidedInterfaceNode) edge.getTo()).getProvided())); + ((ExternalProvidedInterfaceNode) edge.getFrom()) + .getProvided(), ((ProvidedInterfaceNode) edge.getTo()) + .getProvided())); } } @@ -126,14 +123,15 @@ public class ComponentGraph extends Graph { } /** - * Adds a component by adding required interfaces, components, and - * provided interfaces. - * - * @param aComponent Component to add. + * Adds a component by adding required interfaces, components, and provided + * interfaces. + * + * @param aComponent + * Component to add. */ public void addComponent(Component aComponent) { - // Add required interfaces. - Node compNode = new ComponentNode(aComponent); + // Add required interfaces. + Node compNode = new ComponentNode(aComponent); List requiredNodes = new ArrayList(); for (RequiredInterface required : aComponent.getRequiredInterfaces()) { @@ -145,7 +143,7 @@ public class ComponentGraph extends Graph { // Add the component addNode(compNode); - // Edges from component to required interface. + // Edges from component to required interface. for (Node reqNode : requiredNodes) { addEdge(new DefaultEdge(compNode, reqNode)); } @@ -165,11 +163,6 @@ public class ComponentGraph extends Graph { } } - /** - * DOCUMENT ME! - * - * @param aEdgeFilter DOCUMENT ME! - */ public void addEdgeFilter(CompositeEdgeFilter aEdgeFilter) { edgeFilter.add(aEdgeFilter); }