@API.Public public class DocumentReaderWithProjection extends Object implements DocumentReader
DocumentReader interface which can be used to project
a sub-set of fieldsDocumentReader.EventType| Constructor and Description |
|---|
DocumentReaderWithProjection(DocumentReader reader,
FieldProjector projection) |
| Modifier and Type | Method and Description |
|---|---|
int |
getArrayIndex() |
ByteBuffer |
getBinary() |
boolean |
getBoolean() |
byte |
getByte() |
DocumentReader.EventType |
getCurrentEvent() |
ODate |
getDate() |
int |
getDateInt() |
BigDecimal |
getDecimal() |
int |
getDecimalPrecision()
Returns the precision of the current
DECIMAL node. |
int |
getDecimalScale()
Returns the scale of the current
DECIMAL node. |
ByteBuffer |
getDecimalValueAsBytes()
Returns a
ByteBuffer containing the two's complement representation
of the current DECIMAL node. |
int |
getDecimalValueAsInt()
Returns an
int whose value is the unscaled value of this
DECIMAL. |
long |
getDecimalValueAsLong()
Returns a
long whose value is the unscaled value of this
DECIMAL. |
double |
getDouble() |
String |
getFieldName() |
float |
getFloat() |
int |
getInt() |
OInterval |
getInterval() |
int |
getIntervalDays() |
long |
getIntervalMillis() |
long |
getLong() |
short |
getShort() |
String |
getString() |
OTime |
getTime() |
int |
getTimeInt() |
OTimestamp |
getTimestamp() |
long |
getTimestampLong() |
boolean |
inMap() |
DocumentReader.EventType |
next()
Moves the
DocumentReader to the next node and returns the node
type as EventType. |
DocumentReader |
skipChildren()
When called after
DocumentReader.EventType.START_MAP or DocumentReader.EventType.START_ARRAY event,
moves this DocumentReader to the corresponding DocumentReader.EventType.END_MAP or
DocumentReader.EventType.END_ARRAY, skipping the entire sub-tree. |
public DocumentReaderWithProjection(@API.NonNullable DocumentReader reader, @API.NonNullable FieldProjector projection)
public DocumentReader.EventType next()
DocumentReaderDocumentReader to the next node and returns the node
type as EventType.next in interface DocumentReaderEventType for the current node or null if the
reader is past the end of the documentpublic DocumentReader skipChildren()
DocumentReaderDocumentReader.EventType.START_MAP or DocumentReader.EventType.START_ARRAY event,
moves this DocumentReader to the corresponding DocumentReader.EventType.END_MAP or
DocumentReader.EventType.END_ARRAY, skipping the entire sub-tree.
For all other events, this is a NO-OP.skipChildren in interface DocumentReaderthis for chainingpublic boolean inMap()
inMap in interface DocumentReadertrue while traversing a Map, false if traversing
an Arraypublic String getFieldName()
getFieldName in interface DocumentReadernull for the top level Documentpublic int getArrayIndex()
getArrayIndex in interface DocumentReaderpublic byte getByte()
getByte in interface DocumentReaderbyte value of the current nodepublic short getShort()
getShort in interface DocumentReaderbyte value of the current nodepublic int getInt()
getInt in interface DocumentReaderint value of the current nodepublic long getLong()
getLong in interface DocumentReaderlong value of the current nodepublic float getFloat()
getFloat in interface DocumentReaderfloat value of the current nodepublic double getDouble()
getDouble in interface DocumentReaderdouble value of the current nodepublic BigDecimal getDecimal()
getDecimal in interface DocumentReaderBigDecimal value of the current nodepublic int getDecimalPrecision()
DocumentReaderDECIMAL node.
(The precision is the number of digits in the unscaled value.)
The precision of a zero value is 1.
getDecimalPrecision in interface DocumentReaderDECIMAL nodepublic int getDecimalScale()
DocumentReaderDECIMAL node. If the returned
value is zero or positive, the scale is the number of digits to the right
of the decimal point. If negative, the unscaled value of the number is
multiplied by ten to the power of the negation of the scale. For example,
a scale of -3 means the unscaled value is multiplied by 1000.getDecimalScale in interface DocumentReaderDECIMAL nodepublic int getDecimalValueAsInt()
DocumentReaderint whose value is the unscaled value of this
DECIMAL.getDecimalValueAsInt in interface DocumentReaderDECIMAL nodepublic long getDecimalValueAsLong()
DocumentReaderlong whose value is the unscaled value of this
DECIMAL.getDecimalValueAsLong in interface DocumentReaderDECIMAL nodepublic ByteBuffer getDecimalValueAsBytes()
DocumentReaderByteBuffer containing the two's complement representation
of the current DECIMAL node. The byte array will be in big-endian
byte order: the most significant byte is in the zeroth element. The
array will contain the minimum number of bytes required to represent this
DECIMAL, including one sign bit.getDecimalValueAsBytes in interface DocumentReaderDECIMAL nodepublic boolean getBoolean()
getBoolean in interface DocumentReaderboolean value of the current nodepublic String getString()
getString in interface DocumentReaderString value of the current nodepublic long getTimestampLong()
getTimestampLong in interface DocumentReaderTimestamp value of the current node as a long
representing the number of milliseconds since epochpublic OTimestamp getTimestamp()
getTimestamp in interface DocumentReaderTimestamp value of the current nodepublic int getDateInt()
getDateInt in interface DocumentReaderDate value of the current node as an int
representing the number of DAYS since epochpublic ODate getDate()
getDate in interface DocumentReaderDate value of the current nodepublic int getTimeInt()
getTimeInt in interface DocumentReaderTime value of the current node as an int
representing the number of milliseconds since midnight.public OTime getTime()
getTime in interface DocumentReaderTime value of the current nodepublic OInterval getInterval()
getInterval in interface DocumentReaderInterval value of the current nodepublic int getIntervalDays()
getIntervalDays in interface DocumentReaderpublic long getIntervalMillis()
getIntervalMillis in interface DocumentReaderpublic ByteBuffer getBinary()
getBinary in interface DocumentReaderByteBuffer value of the current nodepublic DocumentReader.EventType getCurrentEvent()
getCurrentEvent in interface DocumentReaderDocumentReader.next()Copyright © 2015–2019 MapR Technologies, Inc.. All rights reserved.