maiolum.plainxml.indexing
Class IndexItem

java.lang.Object
  extended bymaiolum.plainxml.indexing.IndexItem

public class IndexItem
extends java.lang.Object

Represents an item in the XML index;

Author:
Robert Novotny

Constructor Summary
IndexItem(java.lang.String tag, long startPosition, long endPosition)
          Instantiate new IndexItem with given parameters.
IndexItem(java.lang.String tag, java.lang.String id, long startPosition, long endPosition)
          Instantiate new IndexItem with given parameters.
 
Method Summary
 boolean equals(java.lang.Object o)
          Two IndexItems are equal if all their attributes are equal.
 long getEndPosition()
          Position of last element character measured in characters from start of the file.
 java.lang.String getId()
          Identifier of given element.
 long getStartPosition()
          Position of first element character measured in characters from start of the file.
 java.lang.String getTag()
          Element name.
 int hashCode()
           
 java.lang.String toString()
          Return String representation of this IndexItem.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexItem

public IndexItem(java.lang.String tag,
                 long startPosition,
                 long endPosition)
Instantiate new IndexItem with given parameters.

Parameters:
tag - Element tag name
startPosition - start position in file measured in characters
endPosition - end position if file measured in characters

IndexItem

public IndexItem(java.lang.String tag,
                 java.lang.String id,
                 long startPosition,
                 long endPosition)
Instantiate new IndexItem with given parameters.

Method Detail

getEndPosition

public long getEndPosition()
Position of last element character measured in characters from start of the file. Remember that position is not equivalent to byte position, since UTF-8 characters can be more than 1-byte long.


getStartPosition

public long getStartPosition()
Position of first element character measured in characters from start of the file. Remember that position is not equivalent to byte position, since UTF-8 characters can be more than 1-byte long.


getTag

public java.lang.String getTag()
Element name. E. g. for <title>> element name is title. Whether this tagname contains namespaces, is determined by IndexReader reading the index.


getId

public java.lang.String getId()
Identifier of given element. Typically, this is the value of ID attribute of given element.


toString

public java.lang.String toString()
Return String representation of this IndexItem.


hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)
Two IndexItems are equal if all their attributes are equal.