public abstract static class DocValues.Source extends Object
BytesRef
depending on the DocValues
fields DocValues.Type
. Source
implementations provide random access semantics similar to array lookups
Modifier and Type | Field and Description |
---|---|
protected DocValues.Type |
type
DocValues.Type of this Source . |
Modifier | Constructor and Description |
---|---|
protected |
DocValues.Source(DocValues.Type type)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
DocValues.SortedSource |
asSortedSource()
If this
DocValues.Source is sorted this method will return an instance of
DocValues.SortedSource otherwise UOE |
Object |
getArray()
Returns the internal array representation iff this
DocValues.Source uses an
array as its inner representation, otherwise UOE . |
BytesRef |
getBytes(int docID,
BytesRef ref)
Returns a
BytesRef for the given document id or throws an
UnsupportedOperationException if this source doesn't support
byte[] values. |
double |
getFloat(int docID)
Returns a double for the given document id or throws an
UnsupportedOperationException if this source doesn't support
double values. |
long |
getInt(int docID)
Returns a long for the given document id or throws an
UnsupportedOperationException if this source doesn't support
long values. |
DocValues.Type |
getType()
Returns the
DocValues.Type of this source. |
boolean |
hasArray()
|
protected final DocValues.Type type
DocValues.Type
of this Source
.protected DocValues.Source(DocValues.Type type)
public long getInt(int docID)
UnsupportedOperationException
if this source doesn't support
long values.UnsupportedOperationException
- if this source doesn't support long values.public double getFloat(int docID)
UnsupportedOperationException
if this source doesn't support
double values.UnsupportedOperationException
- if this source doesn't support double values.public BytesRef getBytes(int docID, BytesRef ref)
BytesRef
for the given document id or throws an
UnsupportedOperationException
if this source doesn't support
byte[] values.UnsupportedOperationException
- if this source doesn't support byte[] values.public DocValues.Type getType()
DocValues.Type
of this source.DocValues.Type
of this source.public boolean hasArray()
true
iff this DocValues.Source
exposes an array via
getArray()
otherwise false
.public Object getArray()
DocValues.Source
uses an
array as its inner representation, otherwise UOE
.public DocValues.SortedSource asSortedSource()
DocValues.Source
is sorted this method will return an instance of
DocValues.SortedSource
otherwise UOE
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.