|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.walend.digraph.path.AbstractDelegateDigraphOfGEPaths.DigraphGEPath
Nested Class Summary | |
protected class |
AbstractDelegateDigraphOfGEPaths.DigraphGEPath.PathEdgeNodeIterator
|
private class |
AbstractDelegateDigraphOfGEPaths.DigraphGEPath.PathNodeIterator
|
Field Summary | |
private AbstractDelegateDigraphOfGEPaths |
container
|
private AbstractDelegateDigraphOfGEPaths.Edge |
edge
|
private java.lang.Object |
head
|
private java.lang.Object |
tail
|
Fields inherited from interface net.walend.digraph.GEDigraph |
EMPTY |
Constructor Summary | |
AbstractDelegateDigraphOfGEPaths.DigraphGEPath(java.lang.Object head,
AbstractDelegateDigraphOfGEPaths.Edge edge,
java.lang.Object tail,
AbstractDelegateDigraphOfGEPaths container)
|
Method Summary | |
private void |
checkEdge(java.lang.Object edge)
|
private void |
checkEdgeIndex(int index)
|
private void |
checkIndices(int startNodeIndex,
int endNodeIndex)
|
private void |
checkNode(java.lang.Object node)
|
private void |
checkNodeIndex(int index)
|
boolean |
containsEdge(java.lang.Object fromNode,
java.lang.Object toNode)
Returns true if edge links fromNode to toNode |
boolean |
containsGEDigraph(GEDigraph digraph)
Returns true if digraph is a subgraph of this GEDigraph. |
boolean |
containsNode(java.lang.Object node)
|
boolean |
containsNodes(java.util.Set nodes)
|
int |
countInboundEdges(java.lang.Object node)
|
int |
countOutboundEdges(java.lang.Object node)
|
int |
edgeCount()
|
EdgeNodeIterator |
edgeNodeIterator()
Returns an iterator that iterates across pairs of nodes that make edges. |
java.util.Set |
getFromNodes(java.lang.Object node)
Returns the set of nodes that can reach this node by crossing one edge. |
java.lang.Object |
getHead()
|
int |
getIndexOfNode(java.lang.Object node)
|
int |
getLastIndexOfNode(java.lang.Object node)
|
java.lang.Object |
getNeck()
|
java.lang.Object |
getNodeAtIndex(int index)
|
java.util.List |
getNodeList()
Returns an immutable list of the nodes. |
java.util.Set |
getNodes()
|
java.lang.Class |
getPrincipleInterface()
Returns the class's principle interface for state comparisons. |
GEPath |
getSubpath(int startNodeIndex,
int endNodeIndex)
Returns a new path, between startNodeIndex and endNodeIndex, inclusive. |
private GEPath |
getSubpath(java.lang.Object startNode,
java.lang.Object endNode)
|
GEPath |
getSubpathFirst(java.lang.Object startNode,
java.lang.Object endNode)
Returns a new path, between the first occurence of startNode and the first occurence of endNode, inclusive. |
GEPath |
getSubpathFirstToLast(java.lang.Object startNode,
java.lang.Object endNode)
Returns a new path, between the first occurence of startNode and the last occurence of endNode, inclusive. |
GEPath |
getSubpathLast(java.lang.Object startNode,
java.lang.Object endNode)
Returns a new path, between the last occurence of startNode and the last occurence of endNode, inclusive. |
GEPath |
getSubpathLastToFirst(java.lang.Object startNode,
java.lang.Object endNode)
Returns a new path, between the last occurence of startNode and the first occurence of endNode, inclusive. |
GEDigraph |
getSupergraph()
Returns the base. |
java.lang.Object |
getTail()
|
java.util.Set |
getToNodes(java.lang.Object node)
Returns the set of nodes that can be reached from this node by crossing one edge. |
GEDigraph |
intersectWithGEDigraph(GEDigraph digraph)
Returns a new digraph that is the intersection of this with digraph. |
boolean |
isEdgeFree()
Returns true if this Digraph has no edges. |
boolean |
isEmpty()
|
int |
nodeCount()
|
java.util.Iterator |
nodeIterator()
Implementations should explicitly state how they interpret nodeIterator()'s remove method. |
int |
pathEdgeCount()
Returns the number of edges in the path, including repeates. |
EdgeNodeIterator |
pathEdgeNodeIterator()
Iterate through the edges in path order. |
int |
pathNodeCount()
Returns the number of nodes in the path, including repeates. |
java.util.Iterator |
pathNodeIterator()
Implementations should explicitly state how they interpret nodeIterator()'s remove method. |
boolean |
sameGEDigraphAs(GEDigraph digraph)
Returns true if digraph is the same as this, and all their contents have the same state. |
boolean |
sameGEPathAs(GEPath path)
Returns true if path is the same path as this, on the same digraph. |
boolean |
sameStateAs(HasState victim)
If two HasStates have the same internal state, return true. |
java.lang.String |
toString()
|
GEDigraph |
unionGEDigraph(GEDigraph digraph)
Returns a new digraph that is the union of this with digraph. |
boolean |
valid()
Returns true if this path is still a subgraph of its supergraph |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private AbstractDelegateDigraphOfGEPaths.Edge edge
private java.lang.Object head
private java.lang.Object tail
private AbstractDelegateDigraphOfGEPaths container
Constructor Detail |
public AbstractDelegateDigraphOfGEPaths.DigraphGEPath(java.lang.Object head, AbstractDelegateDigraphOfGEPaths.Edge edge, java.lang.Object tail, AbstractDelegateDigraphOfGEPaths container)
Method Detail |
public java.lang.Object getNeck()
public GEDigraph getSupergraph()
getSupergraph
in interface GEPath
private void checkEdge(java.lang.Object edge)
private void checkEdgeIndex(int index)
private void checkNodeIndex(int index)
private void checkIndices(int startNodeIndex, int endNodeIndex) throws InvalidSpliceException
InvalidSpliceException
public GEPath getSubpath(int startNodeIndex, int endNodeIndex) throws InvalidSpliceException
getSubpath
in interface GEPath
InvalidSpliceException
private GEPath getSubpath(java.lang.Object startNode, java.lang.Object endNode) throws NodeMissingException, InvalidSpliceException
NodeMissingException
InvalidSpliceException
public GEPath getSubpathFirst(java.lang.Object startNode, java.lang.Object endNode) throws NodeMissingException, InvalidSpliceException
getSubpathFirst
in interface GEPath
NodeMissingException
- if the nodes are not in the path.
InvalidSpliceException
- if the nodes are not in the right order.public GEPath getSubpathLast(java.lang.Object startNode, java.lang.Object endNode) throws NodeMissingException, InvalidSpliceException
getSubpathLast
in interface GEPath
NodeMissingException
- if the nodes are not in the path.
InvalidSpliceException
- if the nodes are not in the right order.public GEPath getSubpathFirstToLast(java.lang.Object startNode, java.lang.Object endNode) throws NodeMissingException, InvalidSpliceException
getSubpathFirstToLast
in interface GEPath
NodeMissingException
- if the nodes are not in the path.
InvalidSpliceException
- if the nodes are not in the right order.public GEPath getSubpathLastToFirst(java.lang.Object startNode, java.lang.Object endNode) throws NodeMissingException, InvalidSpliceException
getSubpathLastToFirst
in interface GEPath
NodeMissingException
- if the nodes are not in the path.
InvalidSpliceException
- if the nodes are not in the right order.public boolean sameGEPathAs(GEPath path)
sameGEPathAs
in interface GEPath
public boolean valid()
valid
in interface Path
public int pathNodeCount()
pathNodeCount
in interface Path
public int pathEdgeCount()
pathEdgeCount
in interface Path
public java.lang.Object getHead()
getHead
in interface Path
public java.lang.Object getTail()
getTail
in interface Path
public java.lang.Object getNodeAtIndex(int index)
getNodeAtIndex
in interface Path
public int getIndexOfNode(java.lang.Object node)
getIndexOfNode
in interface Path
public int getLastIndexOfNode(java.lang.Object node)
getLastIndexOfNode
in interface Path
public java.util.List getNodeList()
getNodeList
in interface Path
public java.util.Iterator pathNodeIterator()
The Iterator should start at the beginning of the path and iterate to the end.
pathNodeIterator
in interface Path
public EdgeNodeIterator pathEdgeNodeIterator()
If Path is immutable, edgeNodeIterator()'s remove() method throws an UnsupportedOperationException.
pathEdgeNodeIterator
in interface Path
public boolean containsEdge(java.lang.Object fromNode, java.lang.Object toNode) throws NodeMissingException
containsEdge
in interface Digraph
NodeMissingException
- if either node is missing from the digraph.private void checkNode(java.lang.Object node) throws NodeMissingException
NodeMissingException
public boolean containsGEDigraph(GEDigraph digraph)
containsGEDigraph
in interface GEDigraph
public boolean sameGEDigraphAs(GEDigraph digraph)
sameGEDigraphAs
in interface GEDigraph
public GEDigraph intersectWithGEDigraph(GEDigraph digraph)
intersectWithGEDigraph
in interface GEDigraph
public GEDigraph unionGEDigraph(GEDigraph digraph)
unionGEDigraph
in interface GEDigraph
public int nodeCount()
nodeCount
in interface Digraph
public int edgeCount()
edgeCount
in interface Digraph
public boolean isEmpty()
isEmpty
in interface Digraph
public boolean containsNode(java.lang.Object node)
containsNode
in interface Digraph
public int countInboundEdges(java.lang.Object node) throws NodeMissingException
countInboundEdges
in interface Digraph
NodeMissingException
- if node is not in the digraph.public int countOutboundEdges(java.lang.Object node) throws NodeMissingException
countOutboundEdges
in interface Digraph
NodeMissingException
- if node is not in the digraph.public java.util.Set getFromNodes(java.lang.Object node) throws NodeMissingException
getFromNodes
in interface Digraph
NodeMissingException
- if node is not in the digraph.public java.util.Set getToNodes(java.lang.Object node) throws NodeMissingException
getToNodes
in interface Digraph
NodeMissingException
- if node is not in the digraph.public java.util.Iterator nodeIterator()
nodeIterator
in interface Digraph
public EdgeNodeIterator edgeNodeIterator()
edgeNodeIterator
in interface Digraph
public java.util.Set getNodes()
getNodes
in interface Digraph
public boolean isEdgeFree()
isEdgeFree
in interface Digraph
public boolean containsNodes(java.util.Set nodes)
containsNodes
in interface Digraph
public java.lang.Class getPrincipleInterface()
HasState
getPrincipleInterface
in interface HasState
public boolean sameStateAs(HasState victim)
HasState
For objects with subobjects, Generally this method should only return true if the internal objects are equal. Implement a contentsHaveSameState() method to determine if the contents have the same state.
sameStateAs
in interface HasState
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |