Class TokenBuffer.Segment
java.lang.Object
tools.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 elements 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.Segmentprotected final Object[]protected longBit field used to store types of buffered tokens; 4 bits per token.private static final tools.jackson.core.JsonToken[]Static array used for fast conversion between token markers and matchingJsonTokeninstancesstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate final int_objectIdIndex(int i) private final int_typeIdIndex(int i) append(int index, tools.jackson.core.JsonToken tokenType) append(int index, tools.jackson.core.JsonToken tokenType, Object value, Object objectId, Object typeId) private final voidassignNativeIds(int index, Object objectId, Object typeId) findObjectId(int index) findTypeId(int index) get(int index) booleanhasIds()Accessor for checking whether this segment may have native type or object ids.next()intrawType(int index) private voidset(int index, tools.jackson.core.JsonToken tokenType) private voidprivate voidprivate voidset(int index, tools.jackson.core.JsonToken tokenType, Object value, Object objectId, Object typeId) tools.jackson.core.JsonTokentype(int index)
-
Field Details
-
TOKENS_PER_SEGMENT
public static final int TOKENS_PER_SEGMENT- See Also:
-
TOKEN_TYPES_BY_INDEX
private static final tools.jackson.core.JsonToken[] TOKEN_TYPES_BY_INDEXStatic array used for fast conversion between token markers and matchingJsonTokeninstances -
_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
-
-
Constructor Details
-
Segment
public Segment()
-
-
Method Details
-
type
public tools.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, tools.jackson.core.JsonToken tokenType, Object objectId, Object typeId) -
append
-
append
public TokenBuffer.Segment append(int index, tools.jackson.core.JsonToken tokenType, Object value, Object objectId, Object typeId) -
set
private void set(int index, tools.jackson.core.JsonToken tokenType) -
set
-
set
-
set
-
assignNativeIds
-
findObjectId
-
findTypeId
-
_typeIdIndex
private final int _typeIdIndex(int i) -
_objectIdIndex
private final int _objectIdIndex(int i)
-