Package org.apache.myfaces.config.util
Class Vertex<T>
java.lang.Object
org.apache.myfaces.config.util.Vertex<T>
- All Implemented Interfaces:
- Comparable<Vertex<T>>
Vertex is used to track dependencies and each node in a graph.  Typical
 uses would be to ensure components are started up and torn down in the
 proper order, or bundles were loaded and unloaded in the proper order, etc.
- Version:
- CVS $ Revision: 1.1 $
- Author:
- Avalon Development Team
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddDependency(Vertex<T> v) Add a dependecy to this Vertex.intUsed in the sort algorithm to sort all the Vertices so that they respect the ordinal they were given during the topological sort.Get the list of dependencies.getName()Returns the name of the Vertex.getNode()Get the wrapped node that this Vertex represents.intgetOrder()Get the ordinal for this vertex.voidreset()Reset the Vertex so that all the flags and runtime states are set back to the original values.voidRecurse through the tree from this vertex assigning an order to each and at the same time checking for any cyclic dependencies.
- 
Constructor Details- 
VertexA vertex wraps a node, which can be anything.- Parameters:
- node- The wrapped node.
 
- 
VertexA vertex wraps a node, which can be anything.- Parameters:
- name- A name for the node which will be used to produce useful errors.
- node- The wrapped node.
 
 
- 
- 
Method Details- 
resetpublic void reset()Reset the Vertex so that all the flags and runtime states are set back to the original values.
- 
getNameReturns the name of the Vertex.- Returns:
- The name of the Vertex.
 
- 
getNodeGet the wrapped node that this Vertex represents.- Returns:
- the node
 
- 
addDependencyAdd a dependecy to this Vertex. The Vertex that this one depends on will be marked as referenced and then added to the list of dependencies. The list is checked before the dependency is added.- Parameters:
- v- The vertex we depend on.
 
- 
resolveOrderRecurse through the tree from this vertex assigning an order to each and at the same time checking for any cyclic dependencies.- Throws:
- CyclicDependencyException- If a cyclic dependency is discovered.
 
- 
getDependenciesGet the list of dependencies.- Returns:
- The list of dependencies.
 
- 
compareToUsed in the sort algorithm to sort all the Vertices so that they respect the ordinal they were given during the topological sort.- Specified by:
- compareToin interface- Comparable<T>
- Parameters:
- o- The other Vertex to compare with
- Returns:
- -1 if this < o, 0 if this == o, or 1 if this > o
 
- 
getOrderpublic int getOrder()Get the ordinal for this vertex.- Returns:
- the order.
 
 
-