The TermPositions type exposes the following members.

Methods

  NameDescription
Public methodClose
Frees associated resources.
(Inherited from TermDocs.)
Public methodDoc
Returns the current document number.

This is invalid until {@link #Next()} is called for the first time.

(Inherited from TermDocs.)
Public methodFreq
Returns the frequency of the term within the current document.

This is invalid until {@link #Next()} is called for the first time.

(Inherited from TermDocs.)
Public methodGetPayload
Returns the payload data at the current term position. This is invalid until {@link #NextPosition()} is called for the first time. This method must not be called more than once after each call of {@link #NextPosition()}. However, payloads are loaded lazily, so if the payload data for the current position is not needed, this method may not be called at all for performance reasons.
Public methodGetPayloadLength
Returns the length of the payload at the current term position. This is invalid until {@link #NextPosition()} is called for the first time.
Public methodIsPayloadAvailable
Checks if a payload can be loaded at this position.

Payloads can only be loaded once per call to {@link #NextPosition()}.

Public methodNext
Moves to the next pair in the enumeration.

Returns true iff there is such a next pair in the enumeration.

(Inherited from TermDocs.)
Public methodNextPosition
Returns next position in the current document. It is an error to call this more than {@link #Freq()} times without calling {@link #Next()}

This is invalid until {@link #Next()} is called for the first time.

Public methodRead
Attempts to read multiple entries from the enumeration, up to length of docs. Document numbers are stored in docs, and term frequencies are stored in freqs. The freqs array must be as long as the docs array.

Returns the number of entries read. Zero is only returned when the stream has been exhausted.

(Inherited from TermDocs.)
Public methodSeek(Term)
Sets this to the data for a term. The enumeration is reset to the start of the data for this term.
(Inherited from TermDocs.)
Public methodSeek(TermEnum)
Sets this to the data for the current term in a {@link TermEnum}. This may be optimized in some implementations.
(Inherited from TermDocs.)
Public methodSkipTo
Skips entries to the first beyond the current whose document number is greater than or equal to target.

Returns true iff there is such an entry.

Behaves as if written:

            boolean skipTo(int target) {
            do {
            if (!next())
            return false;
            } while (target > doc());
            return true;
            }
            
Some implementations are considerably more efficient than that.
(Inherited from TermDocs.)

See Also