@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()
DocumentReader
DocumentReader
to the next node and returns the node
type as EventType
.next
in interface DocumentReader
EventType
for the current node or null
if the
reader is past the end of the documentpublic DocumentReader skipChildren()
DocumentReader
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.
For all other events, this is a NO-OP.skipChildren
in interface DocumentReader
this
for chainingpublic boolean inMap()
inMap
in interface DocumentReader
true
while traversing a Map, false
if traversing
an Arraypublic String getFieldName()
getFieldName
in interface DocumentReader
null
for the top level Documentpublic int getArrayIndex()
getArrayIndex
in interface DocumentReader
public byte getByte()
getByte
in interface DocumentReader
byte
value of the current nodepublic short getShort()
getShort
in interface DocumentReader
byte
value of the current nodepublic int getInt()
getInt
in interface DocumentReader
int
value of the current nodepublic long getLong()
getLong
in interface DocumentReader
long
value of the current nodepublic float getFloat()
getFloat
in interface DocumentReader
float
value of the current nodepublic double getDouble()
getDouble
in interface DocumentReader
double
value of the current nodepublic BigDecimal getDecimal()
getDecimal
in interface DocumentReader
BigDecimal
value of the current nodepublic int getDecimalPrecision()
DocumentReader
DECIMAL
node.
(The precision is the number of digits in the unscaled value.)
The precision of a zero value is 1.
getDecimalPrecision
in interface DocumentReader
DECIMAL
nodepublic int getDecimalScale()
DocumentReader
DECIMAL
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 DocumentReader
DECIMAL
nodepublic int getDecimalValueAsInt()
DocumentReader
int
whose value is the unscaled value of this
DECIMAL
.getDecimalValueAsInt
in interface DocumentReader
DECIMAL
nodepublic long getDecimalValueAsLong()
DocumentReader
long
whose value is the unscaled value of this
DECIMAL
.getDecimalValueAsLong
in interface DocumentReader
DECIMAL
nodepublic ByteBuffer getDecimalValueAsBytes()
DocumentReader
ByteBuffer
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 DocumentReader
DECIMAL
nodepublic boolean getBoolean()
getBoolean
in interface DocumentReader
boolean
value of the current nodepublic String getString()
getString
in interface DocumentReader
String
value of the current nodepublic long getTimestampLong()
getTimestampLong
in interface DocumentReader
Timestamp
value of the current node as a long
representing the number of milliseconds since epochpublic OTimestamp getTimestamp()
getTimestamp
in interface DocumentReader
Timestamp
value of the current nodepublic int getDateInt()
getDateInt
in interface DocumentReader
Date
value of the current node as an int
representing the number of DAYS since epochpublic ODate getDate()
getDate
in interface DocumentReader
Date
value of the current nodepublic int getTimeInt()
getTimeInt
in interface DocumentReader
Time
value of the current node as an int
representing the number of milliseconds since midnight.public OTime getTime()
getTime
in interface DocumentReader
Time
value of the current nodepublic OInterval getInterval()
getInterval
in interface DocumentReader
Interval
value of the current nodepublic int getIntervalDays()
getIntervalDays
in interface DocumentReader
public long getIntervalMillis()
getIntervalMillis
in interface DocumentReader
public ByteBuffer getBinary()
getBinary
in interface DocumentReader
ByteBuffer
value of the current nodepublic DocumentReader.EventType getCurrentEvent()
getCurrentEvent
in interface DocumentReader
DocumentReader.next()
Copyright © 2015–2018 MapR Technologies, Inc.. All rights reserved.