java.lang.Object
de.grogra.graph.ArrayPath
- All Implemented Interfaces:
Path
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanintgetEdgeBits(int index) Returns the edge bits (seeGraph.getEdgeBits(Object)) of the edge atindex.getGraph()Returns the graph which contains this path.getNode(int index) intReturns the number of nodes and edges of this path.getObject(int index) Returns the node or edge atindex.longgetObjectId(int index) intbooleanisInEdgeDirection(int index) Checks whether the path traverses the edge atindexin edge direction or in reverse edge direction.booleanisInstancingEdge(int index) popNode()voidpushEdges(int e, boolean dir, long id, boolean instancing) voidpushEdgeSet(Object edge, long id, boolean instancing) voidvoidtoString()
-
Field Details
-
stack
-
-
Constructor Details
-
ArrayPath
-
ArrayPath
-
-
Method Details
-
getGraph
Description copied from interface:PathReturns the graph which contains this path. -
indexOf
-
clear
-
set
-
pushNode
-
pushEdgeSet
-
pushEdges
public void pushEdges(int e, boolean dir, long id, boolean instancing) -
popNode
-
popEdgeSet
-
getNodeAndEdgeCount
public int getNodeAndEdgeCount()Description copied from interface:PathReturns the number of nodes and edges of this path. If this is even, the path ends in an edge; if this is odd, the path ends in a node.- Specified by:
getNodeAndEdgeCountin interfacePath- Returns:
- number of nodes and edges
-
endsInNode
public boolean endsInNode() -
getObject
Description copied from interface:PathReturns the node or edge atindex. Because a path always starts with a node, even values ofindexaddress nodes, while odd values address edges. Edges may be returned asnull, in this case only the information provided byPath.getEdgeBits(int)andPath.isInEdgeDirection(int)is available for the edge. Ifindexis negative, it is relative to the end of the list, i.e., it is incremented byPath.getNodeAndEdgeCount(). -
getObjectId
public long getObjectId(int index) - Specified by:
getObjectIdin interfacePath
-
getEdgeBits
public int getEdgeBits(int index) Description copied from interface:PathReturns the edge bits (seeGraph.getEdgeBits(Object)) of the edge atindex. Ifindexis negative, it is relative to the end of the list, i.e., it is incremented byPath.getNodeAndEdgeCount(). The actual index has to be odd because edges have odd indices.- Specified by:
getEdgeBitsin interfacePath- Parameters:
index- edge index- Returns:
- edge bits of edge
-
isInEdgeDirection
public boolean isInEdgeDirection(int index) Description copied from interface:PathChecks whether the path traverses the edge atindexin edge direction or in reverse edge direction. Ifindexis negative, it is relative to the end of the list, i.e., it is incremented byPath.getNodeAndEdgeCount(). The actual index has to be odd because edges have odd indices.- Specified by:
isInEdgeDirectionin interfacePath- Parameters:
index- edge index- Returns:
trueiff path traverses edge in its direction
-
isInstancingEdge
public boolean isInstancingEdge(int index) - Specified by:
isInstancingEdgein interfacePath
-
getNode
-
toString
-