| 
 | 
 | |||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.index.tree.TreeIndexPath<E>
public class TreeIndexPath<E extends Entry>
Represents a path to a node in an Index Structure.
| Field Summary | |
|---|---|
| private  TreeIndexPathComponent<E> | lastPathComponentLast path component. | 
| private  TreeIndexPath<E> | parentPathPath representing the parent, null if lastPathComponent represents the root. | 
| Constructor Summary | |
|---|---|
|   | TreeIndexPath(List<TreeIndexPathComponent<E>> path)Constructs a path from a list of path components, uniquely identifying the path from the root of the index to a specific node. | 
| protected  | TreeIndexPath(List<TreeIndexPathComponent<E>> path,
              int length)Constructs a new IndexPath with the identified path components of length length. | 
| protected  | TreeIndexPath(TreeIndexPath<E> parent,
              TreeIndexPathComponent<E> lastElement)Constructs a new IndexPath, which is the path identified by parentending inlastElement. | 
|   | TreeIndexPath(TreeIndexPathComponent<E> singlePath)Constructs a IndexPath containing only a single element. | 
| Method Summary | |
|---|---|
|  boolean | equals(Object o)Tests two IndexPaths for equality by checking each element of the paths for equality. | 
|  TreeIndexPathComponent<E> | getLastPathComponent()Returns the last component of this path. | 
|  TreeIndexPath<E> | getParentPath()Returns a path containing all the elements of this object, except the last path component. | 
|  List<TreeIndexPathComponent<E>> | getPath()Returns an ordered list of IndexPathComponents containing the components of this IndexPath. | 
|  TreeIndexPathComponent<E> | getPathComponent(int element)Returns the path component at the specified index. | 
|  int | getPathCount()Returns the number of elements in the path. | 
|  int | hashCode()Returns the hashCode for the object. | 
|  boolean | isDescendant(TreeIndexPath<E> aIndexPath)Returns true if aIndexPathis a
 descendant of this IndexPath. | 
|  TreeIndexPath<E> | pathByAddingChild(TreeIndexPathComponent<E> child)Returns a new path containing all the elements of this object plus child. | 
|  String | toString()Returns a string that displays and identifies this object's properties. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
private TreeIndexPath<E extends Entry> parentPath
private TreeIndexPathComponent<E extends Entry> lastPathComponent
| Constructor Detail | 
|---|
public TreeIndexPath(List<TreeIndexPathComponent<E>> path)
path - a list of IndexPathComponents representing the path to a nodepublic TreeIndexPath(TreeIndexPathComponent<E> singlePath)
singlePath - a IndexPathComponent representing the path to a node
protected TreeIndexPath(TreeIndexPath<E> parent,
                        TreeIndexPathComponent<E> lastElement)
parent ending in lastElement.
parent - the parent pathlastElement - the last path component
protected TreeIndexPath(List<TreeIndexPathComponent<E>> path,
                        int length)
length.
path - the whole pathlength - the length of the newly created index path| Method Detail | 
|---|
public List<TreeIndexPathComponent<E>> getPath()
public TreeIndexPathComponent<E> getLastPathComponent()
public int getPathCount()
public TreeIndexPathComponent<E> getPathComponent(int element)
element - an int specifying an element in the path, where
                0 is the first element in the path
IllegalArgumentException - if the index is beyond the length
                                  of the pathpublic boolean equals(Object o)
.equals).
equals in class Objecto - the Object to comparepublic int hashCode()
hashCode in class Objectpublic boolean isDescendant(TreeIndexPath<E> aIndexPath)
aIndexPath is a
 descendant of this IndexPath.
 A IndexPath P1 is a descendent of a IndexPath P2
 if P1 contains all of the components that make up
 P2's path.
 For example, if this object has the path [a, b],
 and aIndexPath has the path [a, b, c],
 then aIndexPath is a descendant of this object.
 However, if aIndexPath has the path [a],
 then it is not a descendant of this object.
aIndexPath - the index path to be tested
aIndexPath is a descendant of this pathpublic TreeIndexPath<E> pathByAddingChild(TreeIndexPathComponent<E> child)
child. child will be the last element
 of the newly created IndexPath.
 This will throw a NullPointerException
 if child is null.
child - the last element of the newly created IndexPath
childpublic TreeIndexPath<E> getParentPath()
public String toString()
toString in class Object| 
 | 
 | ||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||