Class TokenBuffer.Segment
java.lang.Object
com.fasterxml.jackson.databind.util.TokenBuffer.Segment
- Enclosing class:
TokenBuffer
Individual segment of TokenBuffer that can store up to 16 tokens
(limited by 4 bits per token type marker requirement).
Current implementation uses fixed length array; could alternatively
use 16 distinct fields and switch statement (slightly more efficient
storage, slightly slower access)
-
Field Summary
FieldsModifier and TypeFieldDescriptionLazily constructed Map for storing native type and object ids, if anyprotected TokenBuffer.Segment
protected final Object[]
protected long
Bit field used to store types of buffered tokens; 4 bits per token.static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend
(int index, com.fasterxml.jackson.core.JsonToken tokenType) append
(int index, com.fasterxml.jackson.core.JsonToken tokenType, Object value, Object objectId, Object typeId) get
(int index) boolean
hasIds()
Accessor for checking whether this segment may have native type or object ids.next()
int
rawType
(int index) com.fasterxml.jackson.core.JsonToken
type
(int index)
-
Field Details
-
TOKENS_PER_SEGMENT
public static final int TOKENS_PER_SEGMENT- See Also:
-
_next
-
_tokenTypes
protected long _tokenTypesBit field used to store types of buffered tokens; 4 bits per token. Value 0 is reserved for "not in use" -
_tokens
-
_nativeIds
Lazily constructed Map for storing native type and object ids, if any
-
-
Constructor Details
-
Segment
public Segment()
-
-
Method Details
-
type
public com.fasterxml.jackson.core.JsonToken type(int index) -
rawType
public int rawType(int index) -
get
-
next
-
hasIds
public boolean hasIds()Accessor for checking whether this segment may have native type or object ids. -
append
-
append
public TokenBuffer.Segment append(int index, com.fasterxml.jackson.core.JsonToken tokenType, Object objectId, Object typeId) -
append
public TokenBuffer.Segment append(int index, com.fasterxml.jackson.core.JsonToken tokenType, Object value) -
append
public TokenBuffer.Segment append(int index, com.fasterxml.jackson.core.JsonToken tokenType, Object value, Object objectId, Object typeId)
-