net.sourceforge.combean.graph.decorators
Class OrderedNodesGraph

Package class diagram package OrderedNodesGraph
java.lang.Object
  extended by net.sourceforge.combean.graph.decorators.AbstractDecoratedGraph
      extended by net.sourceforge.combean.graph.decorators.OrderedNodesGraph
All Implemented Interfaces:
Graph, GlobalNodesGraphProp, NestedGraphProp

public class OrderedNodesGraph
extends AbstractDecoratedGraph
implements GlobalNodesGraphProp

A decorator which returns a specific all nodes iterator, i.e., which enforces traversal of the nodes of the graph in a given order.


Constructor Summary
OrderedNodesGraph(GlobalNodesGraphProp g, NodeIterator itAllNodes)
          Constructor
 
Method Summary
 NodeIterator getAllNodesIterator()
          Return an iterator for all nodes in the graph
 int getNumNodes()
          Return number of nodes in the graph.
 boolean mayNestGraphProp(Class wantedProp)
          All nested properties except those which refer to the global nodes and their identity (GlobalNodesGraphProp and derivatives) may be nested.
 
Methods inherited from class net.sourceforge.combean.graph.decorators.AbstractDecoratedGraph
getEdgeClass, getNestedGraph, getNodeClass, isModifiableGraphProp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.Graph
getEdgeClass, getNodeClass
 

Constructor Detail

OrderedNodesGraph

public OrderedNodesGraph(GlobalNodesGraphProp g,
                         NodeIterator itAllNodes)
Constructor

Parameters:
g - the graph the nodes of which shall be traversed in a specific order
itAllNodes - the iterator (with the current implementation getAllNodesIterator() may only be invoked once on the decorated graph)
Method Detail

getNumNodes

public int getNumNodes()
Description copied from interface: GlobalNodesGraphProp
Return number of nodes in the graph.

Specified by:
getNumNodes in interface GlobalNodesGraphProp
Returns:
number of nodes

getAllNodesIterator

public NodeIterator getAllNodesIterator()
Description copied from interface: GlobalNodesGraphProp
Return an iterator for all nodes in the graph

Specified by:
getAllNodesIterator in interface GlobalNodesGraphProp
Returns:
iterator through all nodes

mayNestGraphProp

public boolean mayNestGraphProp(Class wantedProp)
All nested properties except those which refer to the global nodes and their identity (GlobalNodesGraphProp and derivatives) may be nested.

Specified by:
mayNestGraphProp in interface NestedGraphProp
Parameters:
wantedProp - the property which the user wants to use
Returns:
true if the user may access the nested graph for obtaining the wanted property
See Also:
NestedGraphProp.mayNestGraphProp(java.lang.Class)