public abstract class RandomAccessOrds extends SortedSetDocValues
SortedSetDocValues
that supports random access
to the ordinals of a document.
Operations via this API are independent of the iterator api (SortedSetDocValues.nextOrd()
)
and do not impact its state.
Codecs can optionally extend this API if they support constant-time access to ordinals for the document.
NO_MORE_ORDS
Modifier | Constructor and Description |
---|---|
protected |
RandomAccessOrds()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract int |
cardinality()
Returns the cardinality for the current document (previously
set by
SortedSetDocValues.setDocument(int) . |
abstract long |
ordAt(int index)
Retrieve the ordinal for the current document (previously
set by
SortedSetDocValues.setDocument(int) at the specified index. |
getValueCount, lookupOrd, lookupTerm, nextOrd, setDocument, termsEnum
protected RandomAccessOrds()
public abstract long ordAt(int index)
SortedSetDocValues.setDocument(int)
at the specified index.
An index ranges from 0
to cardinality()-1
.
The first ordinal value is at index 0
, the next at index 1
,
and so on, as for array indexing.
index
- index of the ordinal for the document.public abstract int cardinality()
SortedSetDocValues.setDocument(int)
.Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.