|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.combean.samples.simplegraphs.NumberGraph
public abstract class NumberGraph
This class represents a graph where every node is identified by a long-value.
Field Summary | |
---|---|
static int |
FIRSTNODE
The number of the first node in the graph. |
static int |
NOSUCHNODE
The virtual node number if no such node exists. |
Fields inherited from interface net.sourceforge.combean.interfaces.graph.prop.GlobalIndexedNodesGraphProp |
---|
UNDEFINED_NODE |
Constructor Summary | |
---|---|
NumberGraph()
|
Method Summary | |
---|---|
protected abstract int |
calcNextNode(int sourceNodeNum,
int minNodeNum)
Template method for calculating neighbors. |
boolean |
contains(NumberNode v)
Check whether a given node is contained in the graph. |
NumberNode |
convertNumToNode(int num)
Create a node in the graph.given its number |
boolean |
empty()
Check if the graph is empty. |
NodeIterator |
getAllNodesIterator()
Return an iterator for all nodes in the graph |
Class |
getEdgeClass()
|
Node |
getFirstNode(Edge e)
Return the first node of an edge. |
EdgeIterator |
getIncidentEdges(Node v)
Return an iterator for the local neighborhood of v |
Node |
getNode(int index)
Returns the node with the given index. |
Class |
getNodeClass()
|
int |
getNodeNumber(Node v)
Get the number of a given node. |
Node |
getOtherNode(Edge e,
Node v)
Given an edge and an incident node, return the other node of the edge |
EdgeIterator |
getOutgoingEdges(Node v)
Get all outgoing edges of a given node |
Node |
getSecondNode(Edge e)
Return the second node of an edge. |
protected int |
nextNode(NumberNode startNode,
NumberNode currNode)
Helps NumberNodeIterators to calculate the next node when iterating through neighbors. |
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.prop.GlobalNodesGraphProp |
---|
getNumNodes |
Field Detail |
---|
public static final int FIRSTNODE
public static final int NOSUCHNODE
Constructor Detail |
---|
public NumberGraph()
Method Detail |
---|
public Class getEdgeClass()
getEdgeClass
in interface Graph
public Class getNodeClass()
getNodeClass
in interface Graph
public NodeIterator getAllNodesIterator()
GlobalNodesGraphProp
getAllNodesIterator
in interface GlobalNodesGraphProp
GlobalNodesGraphProp.getAllNodesIterator()
public Node getNode(int index)
GlobalIndexedNodesGraphProp
getNode
in interface GlobalIndexedNodesGraphProp
public int getNodeNumber(Node v)
GlobalNumberedNodesGraphProp
getNodeNumber
in interface GlobalNumberedNodesGraphProp
v
- the node for which the number shall be returned.
public final NumberNode convertNumToNode(int num)
num
- the number of the node to be created
public final EdgeIterator getIncidentEdges(Node v)
NeighborhoodGraphProp
getIncidentEdges
in interface NeighborhoodGraphProp
v
- the node for which the neighborhood shall be given.
public EdgeIterator getOutgoingEdges(Node v)
OutgoingEdgeNeighborhoodGraphProp
getOutgoingEdges
in interface OutgoingEdgeNeighborhoodGraphProp
public final Node getFirstNode(Edge e)
NeighborhoodGraphProp
getFirstNode
in interface NeighborhoodGraphProp
e
- the edge
public final Node getSecondNode(Edge e)
NeighborhoodGraphProp
getSecondNode
in interface NeighborhoodGraphProp
e
- the edge
public final Node getOtherNode(Edge e, Node v)
NeighborhoodGraphProp
getOtherNode
in interface NeighborhoodGraphProp
e
- the given edgev
- the give node
protected int nextNode(NumberNode startNode, NumberNode currNode)
startNode
- the start node of the NumberNeighborIteratorcurrNode
- the current node of the NumberNeighborIterator or null is this
is the first iteration
protected abstract int calcNextNode(int sourceNodeNum, int minNodeNum)
sourceNodeNum
- minNodeNum
-
nextNode(NumberNode, NumberNode)
public final boolean contains(NumberNode v)
v
- the node to be checked
public final boolean empty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |