Class LeafNode

java.lang.Object
  extended byLeafNode
All Implemented Interfaces:
NodeInterface

final class LeafNode
extends java.lang.Object
implements NodeInterface


Field Summary
private  SuffixCoordinates coordinates
          the coordinates of one of the suffixes ending at this leaf node
private  Info info
          May contain additional information about this node (such as lca info).
private  int leftIndex
          The starting index of the branch that leads to this node.
private  int length
          The length of the branch leading to this node.
private  java.lang.Object rightSybling
          Link to the right sybling of this node (if there is one).
 
Constructor Summary
(package private) LeafNode()
           
(package private) LeafNode(int leftIndex, int length, java.lang.Object rightSybling)
           
 
Method Summary
(package private)  void addCoordinates(int position)
          prepends the current coordinates (an object that contains the starting index of the current added suffix) to the list of coordinates - that in case two strings have the same suffix
 SuffixCoordinates getCoordinates()
          Returns the first coordinate object.
 Info getInfo()
          Returns the first info object.
 int getLeftIndex()
           
 int getLength()
           
 java.lang.Object getRightSybling()
           
 void setInfo(Info info)
          prepends the current info to the list of already existing info objects
(package private)  void setLeftIndex(int leftIndex)
           
(package private)  void setLength(int length)
           
(package private)  void setRightSybling(java.lang.Object rightSybling)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftIndex

private int leftIndex
The starting index of the branch that leads to this node. Note that the index is calculated relatively to the first char of the first string inserted in the tree.


length

private int length
The length of the branch leading to this node.


rightSybling

private java.lang.Object rightSybling
Link to the right sybling of this node (if there is one).


info

private Info info
May contain additional information about this node (such as lca info).


coordinates

private SuffixCoordinates coordinates
the coordinates of one of the suffixes ending at this leaf node

Constructor Detail

LeafNode

LeafNode(int leftIndex,
         int length,
         java.lang.Object rightSybling)

LeafNode

LeafNode()
Method Detail

getLeftIndex

public final int getLeftIndex()
Specified by:
getLeftIndex in interface NodeInterface
Returns:
the length on the branch leading to this node.

setLeftIndex

final void setLeftIndex(int leftIndex)

getLength

public final int getLength()
Specified by:
getLength in interface NodeInterface
Returns:
the length of the branch leading to this node.

setLength

final void setLength(int length)

getRightSybling

public final java.lang.Object getRightSybling()
Specified by:
getRightSybling in interface NodeInterface
Returns:
the right sybling of this node, if there is one.

setRightSybling

final void setRightSybling(java.lang.Object rightSybling)

getCoordinates

public final SuffixCoordinates getCoordinates()
Returns the first coordinate object.


addCoordinates

final void addCoordinates(int position)
prepends the current coordinates (an object that contains the starting index of the current added suffix) to the list of coordinates - that in case two strings have the same suffix


getInfo

public final Info getInfo()
Returns the first info object. The access to the next ones are done through the Info interface.

Specified by:
getInfo in interface NodeInterface
Returns:
the first Info object that is associated with the node. One example could be the LcaInfo.

setInfo

public final void setInfo(Info info)
prepends the current info to the list of already existing info objects

Specified by:
setInfo in interface NodeInterface
Returns:
the first Info object that is associated with the node. One example could be the LcaInfo.