FileDocCategorySizeDatePackage
TermVectorOffsetInfo.javaAPI DocApache Lucene 2.2.02879Sat Jun 16 22:20:36 BST 2007org.apache.lucene.index

TermVectorOffsetInfo

public class TermVectorOffsetInfo extends Object
The TermVectorOffsetInfo class holds information pertaining to a Term in a {@link org.apache.lucene.index.TermPositionVector}'s offset information. This offset information is the character offset as set during the Analysis phase (and thus may not be the actual offset in the original content).

Fields Summary
public static final TermVectorOffsetInfo[]
EMPTY_OFFSET_INFO
Convenience declaration when creating a {@link org.apache.lucene.index.TermPositionVector} that stores only position information.
private int
startOffset
private int
endOffset
Constructors Summary
public TermVectorOffsetInfo()


    
  
public TermVectorOffsetInfo(int startOffset, int endOffset)

    this.endOffset = endOffset;
    this.startOffset = startOffset;
  
Methods Summary
public booleanequals(java.lang.Object o)
Two TermVectorOffsetInfos are equals if both the start and end offsets are the same

param
o The comparison Object
return
true if both {@link #getStartOffset()} and {@link #getEndOffset()} are the same for both objects.

    if (this == o) return true;
    if (!(o instanceof TermVectorOffsetInfo)) return false;

    final TermVectorOffsetInfo termVectorOffsetInfo = (TermVectorOffsetInfo) o;

    if (endOffset != termVectorOffsetInfo.endOffset) return false;
    if (startOffset != termVectorOffsetInfo.startOffset) return false;

    return true;
  
public intgetEndOffset()
The accessor for the ending offset for the term

return
The offset

    return endOffset;
  
public intgetStartOffset()
The accessor for the starting offset of the term.

return
The offset

    return startOffset;
  
public inthashCode()

    int result;
    result = startOffset;
    result = 29 * result + endOffset;
    return result;
  
public voidsetEndOffset(int endOffset)

    this.endOffset = endOffset;
  
public voidsetStartOffset(int startOffset)

    this.startOffset = startOffset;