org.apache.lucene.index
Class DocsAndPositionsEnum
java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.index.DocsEnum
org.apache.lucene.index.DocsAndPositionsEnum
- Direct Known Subclasses:
- FilterAtomicReader.FilterDocsAndPositionsEnum, MappingMultiDocsAndPositionsEnum, MultiDocsAndPositionsEnum
public abstract class DocsAndPositionsEnum
- extends DocsEnum
Also iterates through positions.
Method Summary |
abstract int |
endOffset()
Returns end offset for the current position, or -1 if
offsets were not indexed. |
abstract BytesRef |
getPayload()
Returns the payload at this position, or null if no
payload was indexed. |
abstract boolean |
hasPayload()
|
abstract int |
nextPosition()
Returns the next position. |
abstract int |
startOffset()
Returns start offset for the current position, or -1
if offsets were not indexed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocsAndPositionsEnum
public DocsAndPositionsEnum()
nextPosition
public abstract int nextPosition()
throws IOException
- Returns the next position. You should only call this
up to
DocsEnum.freq()
times else
the behavior is not defined. If positions were not
indexed this will return -1; this only happens if
offsets were indexed and you passed needsOffset=true
when pulling the enum.
- Throws:
IOException
startOffset
public abstract int startOffset()
throws IOException
- Returns start offset for the current position, or -1
if offsets were not indexed.
- Throws:
IOException
endOffset
public abstract int endOffset()
throws IOException
- Returns end offset for the current position, or -1 if
offsets were not indexed.
- Throws:
IOException
getPayload
public abstract BytesRef getPayload()
throws IOException
- Returns the payload at this position, or null if no
payload was indexed. Only call this once per
position.
- Throws:
IOException
hasPayload
public abstract boolean hasPayload()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.