The TermPositions type exposes the following members.
Methods
Name | Description | |
---|---|---|
Close | Frees associated resources. (Inherited from TermDocs.) | |
Doc | Returns the current document number. This is invalid until {@link
#Next()} is called for the first time.
(Inherited from TermDocs.) | |
Freq | 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.) | |
GetPayload | 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. | |
GetPayloadLength | Returns the length of the payload at the current term position.
This is invalid until {@link #NextPosition()} is called for
the first time. | |
IsPayloadAvailable | Checks if a payload can be loaded at this position.
Payloads can only be loaded once per call to
{@link #NextPosition()}.
| |
Next | Moves to the next pair in the enumeration. Returns true iff there is
such a next pair in the enumeration.
(Inherited from TermDocs.) | |
NextPosition | 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.
| |
Read | 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.) | |
Seek(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.) | |
Seek(TermEnum) | Sets this to the data for the current term in a {@link TermEnum}.
This may be optimized in some implementations.
(Inherited from TermDocs.) | |
SkipTo | 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: (Inherited from TermDocs.)boolean skipTo(int target) { do { if (!next()) return false; } while (target > doc()); return true; }Some implementations are considerably more efficient than that. |