@API.Public @API.NotThreadSafe public interface DocumentReader
Modifier and Type | Interface and Description |
---|---|
static class |
DocumentReader.EventType |
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. |
DocumentReader.EventType next()
DocumentReader
to the next node and returns the node
type as EventType
.EventType
for the current node or null
if the
reader is past the end of the documentDecodingException
- if the document is malformed or incomplete.DocumentReader.EventType getCurrentEvent()
next()
DocumentReader skipChildren()
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.this
for chainingboolean inMap()
true
while traversing a Map, false
if traversing
an ArrayString getFieldName()
null
for the top level DocumentIllegalStateException
- if the reader is not traversing a Mapint getArrayIndex()
IllegalStateException
- if the reader is not traversing an Arraybyte getByte()
byte
value of the current nodeTypeException
- if the current EventType
is not
BYTE
short getShort()
byte
value of the current nodeTypeException
- if the current EventType
is not
SHORT
.int getInt()
int
value of the current nodeTypeException
- if the current EventType
is not
INT
long getLong()
long
value of the current nodeTypeException
- if the current EventType
is not
LONG
float getFloat()
float
value of the current nodeTypeException
- if the current EventType
is not
FLOAT
double getDouble()
double
value of the current nodeTypeException
- if the current EventType
is not
DOUBLE
BigDecimal getDecimal()
BigDecimal
value of the current nodeTypeException
- if the current EventType
is not
DECIMAL
int getDecimalPrecision()
DECIMAL
node.
(The precision is the number of digits in the unscaled value.)
The precision of a zero value is 1.
DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
int getDecimalScale()
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.DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
int getDecimalValueAsInt()
int
whose value is the unscaled value of this
DECIMAL
.DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
RangeException
- if the precision of the decimal number is greater
than 9long getDecimalValueAsLong()
long
whose value is the unscaled value of this
DECIMAL
.DECIMAL
nodeTypeException
- if the current EventType
is not
DECIMAL
RangeException
- if the precision of the decimal number is greater
than 18ByteBuffer getDecimalValueAsBytes()
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.DECIMAL
nodeboolean getBoolean()
boolean
value of the current nodeTypeException
- if the current EventType
is not
BOOLEAN
String getString()
String
value of the current nodeTypeException
- if the current EventType
is not
STRING
long getTimestampLong()
Timestamp
value of the current node as a long
representing the number of milliseconds since epochTypeException
- if the current EventType
is not
TIMESTAMP
OTimestamp getTimestamp()
Timestamp
value of the current nodeTypeException
- if the current EventType
is not
TIMESTAMP
int getDateInt()
Date
value of the current node as an int
representing the number of DAYS since epochTypeException
- if the current EventType
is not
DATE
ODate getDate()
Date
value of the current nodeTypeException
- if the current EventType
is not
DATE
int getTimeInt()
Time
value of the current node as an int
representing the number of milliseconds since midnight.TypeException
- if the current EventType
is not
TIME
OTime getTime()
Time
value of the current nodeTypeException
- if the current EventType
is not
TIME
OInterval getInterval()
Interval
value of the current nodeTypeException
- if the current EventType
is not
INTERVAL
int getIntervalDays()
long getIntervalMillis()
ByteBuffer getBinary()
ByteBuffer
value of the current nodeTypeException
- if the current EventType
is not
BINARY
Copyright © 2015–2019 MapR Technologies, Inc.. All rights reserved.