public interface TargetTree
Subclasses are responsible for providing the methods to actually access the content of nodes and edges since this interface only specifies the methods for traversing the tree structure.
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases all internal data structures
|
int |
getChildIndexAt(int nodeIndex,
int index) |
int |
getDescendantCount()
Returns the number of nodes in the sub-tree whose root the node currently
being viewed is.
|
int |
getDirection() |
int |
getDistance() |
int |
getEdgeCount()
Returns the number of outgoing edges on the currently viewed
node.
|
int |
getEdgeIndex()
Returns the index of the edge currently being viewed or
-1 if the current scope is not pointed on an edge. |
int |
getHeight()
Returns the height of the sub-tree whose root node is the node currently
being viewed.
|
int |
getNodeIndex()
Returns the index of the node currently being viewed or
-1 if the current scope is not pointed on a node. |
int |
getParentIndex()
Returns the index of the current node's parent node or
-1
if the current node is the root node. |
java.lang.Object |
getProperty(java.lang.String key) |
java.lang.Object |
getSource() |
int |
getSourceIndex()
Returns the index of the source node of the currently viewed edge.
|
int |
getTargetIndex()
Returns the index of the target node of the currently viewed edge.
|
boolean |
isEdgeLocked() |
boolean |
isEdgeLocked(int index) |
boolean |
isEdgeLocked(int nodeIndex,
int index) |
boolean |
isNodeLocked() |
boolean |
isNodeLocked(int index) |
boolean |
isRoot() |
void |
lockEdge() |
void |
lockEdge(int index) |
void |
lockEdge(int nodeIndex,
int index) |
void |
lockNode() |
void |
lockNode(int index) |
void |
reload(java.lang.Object source,
de.ims.icarus.util.Options options)
Rebuild the graph representation based on the given data input.
|
void |
reset()
Clears any pointer structures and unlocks all locking flags
|
int |
size()
Returns the number of nodes (vertices) in the tree
|
void |
unlockAll() |
void |
unlockChildren(int index) |
void |
unlockEdge() |
void |
unlockEdge(int index) |
void |
unlockEdge(int nodeIndex,
int index) |
void |
unlockNode() |
void |
unlockNode(int index) |
void |
viewChild(int index) |
void |
viewEdge(int index)
Moves the scope to the edge at position
index of the
current node. |
void |
viewEdge(int nodeIndex,
int edgeIndex)
Moves the scope to the edge at position
index of the
node specified by nodeIndex . |
void |
viewNode(int index)
Moves the scope to the node at position
index in the graph. |
void |
viewParent()
Moves the scope to the node that is the parent of the current node.
|
void |
viewSource() |
void |
viewTarget() |
int size()
void reset()
void close()
void reload(java.lang.Object source, de.ims.icarus.util.Options options)
java.lang.Object getSource()
int getNodeIndex()
-1
if the current scope is not pointed on a node.int getEdgeIndex()
-1
if the current scope is not pointed on an edge.int getChildIndexAt(int nodeIndex, int index)
int getEdgeCount()
java.lang.IllegalStateException
- in case the scope is not pointed on
a nodevoid viewEdge(int index)
index
of the
current node.
Precondition: #getNodeIndex()
!=-1 && #getEdgeIndex()
==-1
Postcondition: #getEdgeIndex()
==index && #getNodeIndex()
==-1
java.lang.IllegalStateException
- in case the scope is not pointed on
a nodejava.lang.IndexOutOfBoundsException
- in case the provided index
is
out of bounds: 0≤index<edgeCountvoid viewEdge(int nodeIndex, int edgeIndex)
index
of the
node specified by nodeIndex
.
Postcondition: #getEdgeIndex()
==edgeIndex && #getNodeIndex()
==-1
java.lang.IndexOutOfBoundsException
- in case the provided nodeIndex
is
not in the range of 0 ≤ nodeIndex < size()
or edgeIndex
is
out of bounds: 0 ≤ index < getEdgeCount()
when moved to the
new node.int getSourceIndex()
java.lang.IllegalStateException
- in case the scope is not pointed on
an edgeint getTargetIndex()
java.lang.IllegalStateException
- in case the scope is not pointed on
an edgeint getParentIndex()
-1
if the current node is the root node.java.lang.IllegalStateException
- in case the scope is not pointed on
a nodevoid viewNode(int index)
index
in the graph.
Precondition: #getNodeIndex()
!=-1 && #getEdgeIndex()
==-1
Postcondition: #getEdgeIndex()
==index && #getNodeIndex()
==-1
java.lang.IllegalStateException
- in case the scope is not pointed on
a nodejava.lang.IndexOutOfBoundsException
- in case the provided index
is
out of bounds: 0≤index<edgeCountvoid viewChild(int index)
int getHeight()
1
and for any
other node it is 1
plus the maximum of any of its child nodes height.java.lang.IllegalStateException
- in case the scope is not pointed on
a nodeint getDescendantCount()
0
for leaf nodes.java.lang.IllegalStateException
- in case the scope is not pointed on
a nodevoid viewParent()
Precondition: #getNodeIndex()
!=-1 && #getEdgeIndex()
==-1 && i
==#getParentIndex()
Postcondition: #getEdgeIndex()
==-1 && #getNodeIndex()
==i
java.lang.IllegalStateException
- in case the scope is not pointed on
a node or the current node is the root nodevoid viewTarget()
void viewSource()
boolean isRoot()
java.lang.Object getProperty(java.lang.String key)
int getDirection()
int getDistance()
void lockNode()
void lockEdge()
void lockEdge(int index)
void lockEdge(int nodeIndex, int index)
void lockNode(int index)
void unlockNode()
void unlockEdge()
void unlockEdge(int index)
void unlockEdge(int nodeIndex, int index)
void unlockNode(int index)
void unlockChildren(int index)
boolean isNodeLocked()
boolean isEdgeLocked()
boolean isNodeLocked(int index)
boolean isEdgeLocked(int index)
boolean isEdgeLocked(int nodeIndex, int index)
void unlockAll()