de.grogra.graph
| Modifier and Type | Field and Description |
|---|---|
ObjectList |
stack |
| Constructor and Description |
|---|
ArrayPath(Graph graph) |
ArrayPath(Path path) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Graph graph) |
boolean |
endsInNode() |
int |
getEdgeBits(int index)
Returns the edge bits (see
Graph.getEdgeBits(Object))
of the edge at index. |
Graph |
getGraph()
Returns the graph which contains this path.
|
java.lang.Object |
getNode(int index) |
int |
getNodeAndEdgeCount()
Returns the number of nodes and edges of this path.
|
java.lang.Object |
getObject(int index)
Returns the node or edge at
index. |
long |
getObjectId(int index) |
int |
indexOf(java.lang.Object object,
boolean asNode) |
boolean |
isInEdgeDirection(int index)
Checks whether the path traverses the edge at
index
in edge direction or in reverse edge direction. |
boolean |
isInstancingEdge(int index) |
java.lang.Object |
popEdgeSet() |
java.lang.Object |
popNode() |
void |
pushEdges(int e,
boolean dir,
long id,
boolean instancing) |
void |
pushEdgeSet(java.lang.Object edge,
long id,
boolean instancing) |
void |
pushNode(java.lang.Object node,
long id) |
void |
set(Path path) |
java.lang.String |
toString() |
public final ObjectList stack
public void clear(Graph graph)
public boolean endsInNode()
public int getEdgeBits(int index)
PathGraph.getEdgeBits(Object))
of the edge at index.
If index is negative, it is relative to the end
of the list, i.e., it is incremented by Path.getNodeAndEdgeCount().
The actual index has to be odd because edges have odd indices.getEdgeBits in interface Pathindex - edge indexpublic Graph getGraph()
Pathpublic java.lang.Object getNode(int index)
public int getNodeAndEdgeCount()
PathgetNodeAndEdgeCount in interface Pathpublic java.lang.Object getObject(int index)
Pathindex. Because a path
always starts with a node, even values of index address
nodes, while odd values address edges. Edges may be returned
as null, in this case only the information provided
by Path.getEdgeBits(int) and Path.isInEdgeDirection(int)
is available for the edge.
If index is negative, it is relative to the end
of the list, i.e., it is incremented by Path.getNodeAndEdgeCount().public long getObjectId(int index)
getObjectId in interface Pathpublic int indexOf(java.lang.Object object,
boolean asNode)
public boolean isInEdgeDirection(int index)
Pathindex
in edge direction or in reverse edge direction.
If index is negative, it is relative to the end
of the list, i.e., it is incremented by Path.getNodeAndEdgeCount().
The actual index has to be odd because edges have odd indices.isInEdgeDirection in interface Pathindex - edge indextrue iff path traverses edge in its directionpublic boolean isInstancingEdge(int index)
isInstancingEdge in interface Pathpublic java.lang.Object popEdgeSet()
public java.lang.Object popNode()
public void pushEdges(int e,
boolean dir,
long id,
boolean instancing)
public void pushEdgeSet(java.lang.Object edge,
long id,
boolean instancing)
public void pushNode(java.lang.Object node,
long id)
public void set(Path path)
public java.lang.String toString()
toString in class java.lang.Object