net.sourceforge.combean.samples.simplegraphs
Class CompositeNumberGraph

Package class diagram package CompositeNumberGraph
java.lang.Object
  extended by net.sourceforge.combean.samples.simplegraphs.NumberGraph
      extended by net.sourceforge.combean.samples.simplegraphs.CompositeNumberGraph
All Implemented Interfaces:
Graph, GlobalIndexedNodesGraphProp, GlobalNodesGraphProp, GlobalNumberedNodesGraphProp, NeighborhoodGraphProp, OutgoingEdgeNeighborhoodGraphProp

public class CompositeNumberGraph
extends NumberGraph


Field Summary
 
Fields inherited from class net.sourceforge.combean.samples.simplegraphs.NumberGraph
FIRSTNODE, NOSUCHNODE
 
Fields inherited from interface net.sourceforge.combean.interfaces.graph.prop.GlobalIndexedNodesGraphProp
UNDEFINED_NODE
 
Constructor Summary
CompositeNumberGraph()
           
 
Method Summary
 void add(NumberGraph g)
           
 void add(NumberGraph g, int offset)
           
protected  int calcNextNode(int sourceNodeNum, int minNodeNum)
          Template method for calculating neighbors.
 int getNumGraphs()
           
 int getNumNodes()
          Return number of nodes in the graph.
 
Methods inherited from class net.sourceforge.combean.samples.simplegraphs.NumberGraph
contains, convertNumToNode, empty, getAllNodesIterator, getEdgeClass, getFirstNode, getIncidentEdges, getNode, getNodeClass, getNodeNumber, getOtherNode, getOutgoingEdges, getSecondNode, nextNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeNumberGraph

public CompositeNumberGraph()
Method Detail

calcNextNode

protected int calcNextNode(int sourceNodeNum,
                           int minNodeNum)
Description copied from class: NumberGraph
Template method for calculating neighbors. Calculates the smallest number >= minNodeNum of a node in the neighborhood of the node with the number sourceNumNode or NOSUCHNODE if no next node exists. It is guaranteed that the graph in non-empty and that the node number startNodeNum is contained in the graph. Note that minNodeNum may also be negative.

Specified by:
calcNextNode in class NumberGraph
Returns:
the next node in the neighborhood of the given node
See Also:
NumberGraph.calcNextNode(int, int)

getNumNodes

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

Returns:
number of nodes
See Also:
GlobalNodesGraphProp.getNumNodes()

add

public void add(NumberGraph g)

add

public void add(NumberGraph g,
                int offset)

getNumGraphs

public int getNumGraphs()