|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.xqhs.graphs.representation.linear.PathElement
public class PathElement
Class for the element of a path in a graph linearization (see LinearGraphRepresentation
).
Each path element is associated with a node in the graph (seen as a Node
implementation).
An instance contains information about the node, the distance from the start of the path, the previous node in the path (its parent), and its children: "own children" are the children of the node, according to the tree represented by the path. The "other children" are nodes connected with the current one (there exist edges from the node to the children), but have been marked by the algorithm as "own children" of another path element.
Field Summary | |
---|---|
(package private) java.util.List<PathElement> |
children
The (ordered) list of children ("own children") of the current element in the path. |
(package private) int |
depth
The distance from the root of the path. |
(package private) int |
forwardLength
The distance, in the path, from the current element to the farthest leaf in the path. |
(package private) Node |
node
The node to which this instance is associated. |
(package private) java.util.List<PathElement> |
otherChildren
The (ordered) list of nodes / elements that are connected to the node, but are not children of it in the current path ("other children"). |
(package private) PathElement |
parent
The parent of the element, in the current path. |
Constructor Summary | |
---|---|
PathElement(Node node,
int distance,
PathElement parent)
Creates a new instance, associated with a Node instance. |
Method Summary | |
---|---|
java.util.List<PathElement> |
getChildren()
|
Node |
getNode()
|
java.util.List<PathElement> |
getOtherChildren()
|
boolean |
pathContains(PathElement el1)
Checks if the path from root to the current node already contains a specified element. |
java.lang.String |
toString()
Returns a compact string representation of the path element: |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Node node
int depth
int forwardLength
PathElement parent
java.util.List<PathElement> children
java.util.List<PathElement> otherChildren
Constructor Detail |
---|
public PathElement(Node node, int distance, PathElement parent)
Node
instance. The constructor requires the parent and the
distance from root.
node
- : the associated node.distance
- : the distance from root (depth of the node). 0 is for root.parent
- : the parent element, in the current path.Method Detail |
---|
public boolean pathContains(PathElement el1)
el1
- : the element to check for.
true
if the element is contained on the path, false
otherwise.public java.lang.String toString()
node label (depth : parent / n-children : n-otherChildren / forwardLength
toString
in class java.lang.Object
public Node getNode()
public java.util.List<PathElement> getChildren()
public java.util.List<PathElement> getOtherChildren()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |