|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.index.tree.IndexTreePath<E>
E
- the type of Entry used in the indexpublic class IndexTreePath<E extends Entry>
Represents a path to a node in an index structure.
Field Summary | |
---|---|
private TreeIndexPathComponent<E> |
lastPathComponent
Last path component. |
private IndexTreePath<E> |
parentPath
Path representing the parent, null if lastPathComponent represents the root. |
Constructor Summary | |
---|---|
protected |
IndexTreePath(IndexTreePath<E> parent,
TreeIndexPathComponent<E> lastElement)
Constructs a new IndexPath, which is the path identified by parent ending in lastElement . |
|
IndexTreePath(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 |
IndexTreePath(List<TreeIndexPathComponent<E>> path,
int length)
Constructs a new IndexPath with the identified path components of length length . |
|
IndexTreePath(TreeIndexPathComponent<E> singlePath)
Constructs a IndexPath containing only a single element. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true if this == o has the value
true or o is not null and o is of the same class as this
instance and the two index paths are of the same length, and contain the
same components (.equals ), false otherwise. |
TreeIndexPathComponent<E> |
getLastPathComponent()
Returns the last component of this path. |
IndexTreePath<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 hash code for this index path. |
boolean |
isDescendant(IndexTreePath<E> aIndexPath)
Returns true if aIndexPath is a descendant of this IndexPath. |
IndexTreePath<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 the components of this index path. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private IndexTreePath<E extends Entry> parentPath
private TreeIndexPathComponent<E extends Entry> lastPathComponent
Constructor Detail |
---|
public IndexTreePath(List<TreeIndexPathComponent<E>> path)
path
- a list of IndexPathComponents representing the path to a nodepublic IndexTreePath(TreeIndexPathComponent<E> singlePath)
singlePath
- a IndexPathComponent representing the path to a nodeprotected IndexTreePath(IndexTreePath<E> parent, TreeIndexPathComponent<E> lastElement)
parent
ending in lastElement
.
parent
- the parent pathlastElement
- the last path componentprotected IndexTreePath(List<TreeIndexPathComponent<E>> path, int length)
length
.
path
- the whole pathlength
- the length of the newly created index pathMethod 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)
true
if this == o
has the value
true
or o is not null and o is of the same class as this
instance and the two index paths are of the same length, and contain the
same components (.equals
), false
otherwise.
equals
in class Object
TreeIndexPathComponent.equals(Object)
public int hashCode()
hashCode
in class Object
public boolean isDescendant(IndexTreePath<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 IndexTreePath<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
child
public IndexTreePath<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 |