net.sourceforge.combean.samples.simplegraphs
Class DirectedCircle
java.lang.Object
net.sourceforge.combean.samples.simplegraphs.NumberGraph
net.sourceforge.combean.samples.simplegraphs.SimpleNumberGraph
net.sourceforge.combean.samples.simplegraphs.DirectedCircle
- All Implemented Interfaces:
- Graph, GlobalIndexedNodesGraphProp, GlobalNodesGraphProp, GlobalNumberedNodesGraphProp, NeighborhoodGraphProp, OutgoingEdgeNeighborhoodGraphProp
public class DirectedCircle
- extends SimpleNumberGraph
A directed circle.
Method Summary |
protected int |
calcNextNode(int sourceNodeNum,
int minNodeNum)
Template method for calculating neighbors. |
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 |
DirectedCircle
public DirectedCircle(int size)
- Parameters:
size
-
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.nextNode(NumberNode, NumberNode)