Class IndexTreePath<E>

  • Type Parameters:
    E - the type of Entry used in the index

    public class IndexTreePath<E>
    extends java.lang.Object
    Represents a path to a node in an index structure.
    Since:
    0.1
    Author:
    Elke Achtert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private E entry
      The entry of this component.
      private int index
      The index of this component in its parent.
      private IndexTreePath<E> parentPath
      Path representing the parent, null if lastPathComponent represents the root.
    • Constructor Summary

      Constructors 
      Constructor Description
      IndexTreePath​(IndexTreePath<E> parent, E entry, int index)
      Constructs a new IndexPath.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      E getEntry()
      Returns the entry of the component.
      int getIndex()
      Returns the index of the component in its parent.
      IndexTreePath<E> getParentPath()
      Returns a path containing all the elements of this object, except the last path component.
      int getPathCount()
      Returns the number of elements in the path.
      int hashCode()  
      java.lang.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

      • parentPath

        private IndexTreePath<E> parentPath
        Path representing the parent, null if lastPathComponent represents the root.
      • entry

        private final E entry
        The entry of this component.
      • index

        private final int index
        The index of this component in its parent.
    • Constructor Detail

      • IndexTreePath

        public IndexTreePath​(IndexTreePath<E> parent,
                             E entry,
                             int index)
        Constructs a new IndexPath.
        Parameters:
        parent - the parent path
        entry - the entry of the component
        index - index of the component in its parent
    • Method Detail

      • getEntry

        public E getEntry()
        Returns the entry of the component.
        Returns:
        the entry of the component
      • getIndex

        public int getIndex()
        Returns the index of the component in its parent.
        Returns:
        the index of the component in its parent
      • getPathCount

        public int getPathCount()
        Returns the number of elements in the path.
        Returns:
        an int giving a count of items the path
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getParentPath

        public IndexTreePath<E> getParentPath()
        Returns a path containing all the elements of this object, except the last path component.
        Returns:
        a path containing all the elements of this object, except the last path component
      • toString

        public java.lang.String toString()
        Returns a string that displays the components of this index path.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the components of this index path