Class Binary
java.lang.Object
one.microstream.persistence.binary.types.Binary
- All Implemented Interfaces:
Chunk
- Direct Known Subclasses:
BinaryLoadItem
,ChunksBuffer
,ChunksWrapper
public abstract class Binary extends Object implements Chunk
-
Method Summary
Modifier and Type Method Description static long
binaryListMaximumLength()
static long
binaryListMinimumLength()
abstract ByteBuffer[]
buffers()
boolean[]
build_booleans()
boolean[]
build_booleans(long listOffset)
byte[]
build_bytes()
byte[]
build_bytes(long listOffset)
char[]
build_chars()
char[]
build_chars(long listOffset)
double[]
build_doubles()
double[]
build_doubles(long listOffset)
float[]
build_floats()
float[]
build_floats(long listOffset)
int[]
build_ints()
int[]
build_ints(long listOffset)
long[]
build_longs()
long[]
build_longs(long listOffset)
short[]
build_shorts()
short[]
build_shorts(long listOffset)
Boolean
buildBoolean()
Boolean
buildBoolean(long offset)
Byte
buildByte()
Byte
buildByte(long offset)
Character
buildCharacter()
Character
buildCharacter(long offset)
Double
buildDouble()
Double
buildDouble(long offset)
Float
buildFloat()
Float
buildFloat(long offset)
Integer
buildInteger()
Integer
buildInteger(long offset)
Long
buildLong()
Long
buildLong(long offset)
Object
buildPrimitiveWrapper(Class<?> primitiveValueType)
Object
buildPrimitiveWrapper(Class<?> primitiveValueType, long offset)
<T extends XAddingMap<String, Long>>
TbuildRootMapping(T mapping)
Short
buildShort()
Short
buildShort(long offset)
String
buildString()
String
buildString(long offset)
String[]
buildStrings(long stringsListOffset)
static long
calculateBinaryLengthChars(long count)
static long
calculateReferenceListTotalBinaryLength(long count)
static long
calculateStringListContentBinaryLength(String[] strings)
abstract Binary
channelChunk(int channelIndex)
abstract int
channelCount()
void
collectElementsIntoArray(long binaryOffset, PersistenceLoadHandler handler, Object[] target)
int
collectKeyValueReferences(long binaryOffset, int length, PersistenceLoadHandler handler, BiConsumer<Object,Object> collector)
int
collectListObjectReferences(long binaryOffset, PersistenceLoadHandler handler, Consumer<Object> collector)
void
collectObjectReferences(long binaryOffset, int length, PersistenceLoadHandler handler, Consumer<Object> collector)
void
copyMemory(ByteBuffer directByteBuffer, long offset, BinaryValueSetter[] setters, long[] targetOffsets)
boolean[]
create_booleans()
boolean[]
create_booleans(long listOffset)
byte[]
create_bytes()
byte[]
create_bytes(long listOffset)
char[]
create_chars()
char[]
create_chars(long listOffset)
double[]
create_doubles()
double[]
create_doubles(long listOffset)
float[]
create_floats()
float[]
create_floats(long listOffset)
int[]
create_ints()
int[]
create_ints(long listOffset)
long[]
create_longs()
long[]
create_longs(long listOffset)
short[]
create_shorts()
short[]
create_shorts(long listOffset)
static long
entityContentLength(long entityTotalLength)
static int
entityHeaderLength()
static long
entityTotalLength(long entityContentLength)
static <T, R> BinaryField<T>
Field(Class<R> referenceType, String name, Getter<T,R> getter)
static <T, R> BinaryField<T>
Field(Class<R> referenceType, String name, Getter<T,R> getter, Setter<T,R> setter)
static <T> BinaryField<T>
Field_boolean(String name, Getter_boolean<T> getter)
static <T> BinaryField<T>
Field_boolean(String name, Getter_boolean<T> getter, Setter_boolean<T> setter)
static <T> BinaryField<T>
Field_byte(String name, Getter_byte<T> getter)
static <T> BinaryField<T>
Field_byte(String name, Getter_byte<T> getter, Setter_byte<T> setter)
static <T> BinaryField<T>
Field_char(String name, Getter_char<T> getter)
static <T> BinaryField<T>
Field_char(String name, Getter_char<T> getter, Setter_char<T> setter)
static <T> BinaryField<T>
Field_double(String name, Getter_double<T> getter)
static <T> BinaryField<T>
Field_double(String name, Getter_double<T> getter, Setter_double<T> setter)
static <T> BinaryField<T>
Field_float(String name, Getter_float<T> getter)
static <T> BinaryField<T>
Field_float(String name, Getter_float<T> getter, Setter_float<T> setter)
static <T> BinaryField<T>
Field_int(String name, Getter_int<T> getter)
static <T> BinaryField<T>
Field_int(String name, Getter_int<T> getter, Setter_int<T> setter)
static <T> BinaryField<T>
Field_long(String name, Getter_long<T> getter)
static <T> BinaryField<T>
Field_long(String name, Getter_long<T> getter, Setter_long<T> setter)
static <T> BinaryField<T>
Field_short(String name, Getter_short<T> getter)
static <T> BinaryField<T>
Field_short(String name, Getter_short<T> getter, Setter_short<T> setter)
long
getBinaryListElementCountUnvalidating(long listOffset)
long
getBinaryListElementCountValidating(long listOffset, long elementLength)
long
getBinaryListTotalByteLength(long listOffset)
long
getBuildItemContentLength()
long
getBuildItemObjectId()
long
getBuildItemTotalLength()
long
getBuildItemTypeId()
static long
getEntityLengthRawValue(long entityAddress)
static long
getEntityObjectIdRawValue(long entityAddress)
static long
getEntityTypeIdRawValue(long entityAddress)
Object
getHelper(Object key)
Helper instances can be used as temporary additional state for the duration of the building process.long
getListElementCount(long listStartOffset, int elementLength)
long
getListElementCountKeyValue(long listStartOffset)
long
getListElementCountReferences(long listStartOffset)
long
getLoadItemAvailableContentLength()
int
getSizedArrayElementCount(long headerOffset)
long
getSizedArrayElementsAddress(long headerOffset)
int
getSizedArrayLength(long sizedArrayOffset)
protected boolean
isDummyItem()
protected boolean
isProper()
boolean
isSwitchedByteOrder()
static boolean
isValidEntityLength(long entityLength)
static boolean
isValidGapLength(long gapLength)
abstract void
iterateChannelChunks(Consumer<? super Binary> logic)
abstract void
iterateEntityData(BinaryEntityDataReader reader)
void
iterateKeyValueEntriesReferences(long listOffset, PersistenceObjectIdAcceptor iterator)
void
iterateListElementReferences(long listOffset, PersistenceObjectIdAcceptor iterator)
static void
iterateListStructureCompositeElements(Binary data, long elementsListOffset, int elementReferencesOffset, int elementReferenceCount, int elementTrailingBytes, PersistenceReferenceLoader iterator)
Usage example:
For an entity solely consisting of a list of elements with each (2 ints, 1 float, 1 reference), call:
iterateReferences(data, 0, 12, 1, 0, iterator)
.
(2*4 bytes + 1*4 bytes, 1 reference, no trailing bytes)long
iterateListStructureElements(long listOffset, BinaryElementReader reader)
Iterates over all elements of a binary list.void
iterateListStructureReferenceRange(long listOffset, int referencesPerElement, PersistenceObjectIdAcceptor iterator)
void
iterateReferenceRange(long startOffset, long boundOffset, PersistenceObjectIdAcceptor iterator)
void
iterateReferenceRangeUnvalidated(long startOffset, long boundOffset, PersistenceObjectIdAcceptor iterator)
abstract long
iterateReferences(BinaryReferenceTraverser[] traversers, PersistenceObjectIdAcceptor acceptor)
void
iterateSizedArrayElementReferences(long offset, PersistenceObjectIdAcceptor iterator)
static long
keyValueBinaryLength()
static long
keyValueReferenceCount(long elementCount)
static int
lengthLength()
abstract void
mark()
abstract void
modifyLoadItem(ByteBuffer directByteBuffer, long offset, long entityTotalLength, long entityTypeId, long entityObjectId)
static int
objectIdByteLength()
boolean
read_boolean(long offset)
byte
read_byte(long offset)
char
read_char(long offset)
double
read_double(long offset)
float
read_float(long offset)
int
read_int(long offset)
long
read_long(long offset)
short
read_short(long offset)
static long
referenceBinaryLength(long referenceCount)
void
registerHelper(Object key, Object helper)
Helper instances can be used as temporary additional state for the duration of the building process.abstract void
reset()
void
store_boolean(boolean value)
void
store_boolean(long offset, boolean value)
void
store_booleans(long typeId, long objectId, boolean[] array)
void
store_byte(byte value)
void
store_byte(long offset, byte value)
void
store_bytes(long typeId, long objectId, byte[] array)
void
store_char(char value)
void
store_char(long offset, char value)
void
store_chars(long typeId, long objectId, char[] array)
void
store_double(double value)
void
store_double(long offset, double value)
void
store_doubles(long typeId, long objectId, double[] array)
void
store_float(float value)
void
store_float(long offset, float value)
void
store_floats(long typeId, long objectId, float[] array)
void
store_int(int value)
void
store_int(long offset, int value)
void
store_ints(long typeId, long objectId, int[] array)
void
store_long(long value)
void
store_long(long offset, long value)
void
store_longs(long typeId, long objectId, long[] array)
void
store_short(long offset, short value)
void
store_short(short value)
void
store_shorts(long typeId, long objectId, short[] array)
void
storeBoolean(long typeId, long objectId, boolean value)
void
storeByte(long typeId, long objectId, byte value)
void
storeCharacter(long typeId, long objectId, char value)
long
storeCharsAsList(long memoryOffset, char[] chars, int offset, int length)
void
storeDouble(long typeId, long objectId, double value)
abstract void
storeEntityHeader(long entityContentLength, long entityTypeId, long entityObjectId)
void
storeFixedSize(PersistenceStoreHandler<Binary> handler, long contentLength, long typeId, long objectId, Object instance, long[] memoryOffsets, BinaryValueStorer[] storers)
void
storeFloat(long typeId, long objectId, float value)
void
storeInteger(long typeId, long objectId, int value)
void
storeIterableAsList(long tid, long oid, long headerOffset, Iterable<?> elements, long size, PersistenceFunction persister)
void
storeIterableContentAsList(long offset, PersistenceFunction persister, Iterable<?> elements, long elementCount)
void
storeKeyValuesAsEntries(long typeId, long objectId, long headerOffset, Iterable<? extends KeyValue<?,?>> keyValues, long size, PersistenceFunction persister)
void
storeKeyValuesAsEntries(long offset, PersistenceFunction persister, Iterable<? extends KeyValue<?,?>> elements, long elementCount)
void
storeListHeader(long offset, long elementsBinaryLength, long elementsCount)
void
storeLong(long typeId, long objectId, long value)
<K, V> void
storeMapEntrySet(long typeId, long objectId, long headerOffset, Set<Map.Entry<K,V>> entrySet, PersistenceFunction persister)
void
storeReferences(long typeId, long objectId, long binaryOffset, PersistenceFunction persister, Object[] array)
void
storeReferences(long typeId, long objectId, long binaryOffset, PersistenceFunction persister, Object[] array, int arrayOffset, int arrayLength)
void
storeReferencesAsList(long memoryOffset, PersistenceFunction persister, Object[] array, int offset, int length)
void
storeRoots(long typeId, long objectId, XGettingTable<String,Object> entries, PersistenceFunction persister)
void
storeShort(long typeId, long objectId, short value)
void
storeSizedArray(long tid, long oid, long headerOffset, Object[] array, int offset, int size, PersistenceFunction persister)
void
storeSizedArray(long tid, long oid, long headerOffset, Object[] array, int size, PersistenceFunction persister)
void
storeStateless(long typeId, long objectId)
void
storeStringsAsList(long memoryOffset, long precalculatedContentBinaryLength, String[] strings)
void
storeStringsAsList(long memoryOffset, long precalculatedContentBinaryLength, String[] strings, int offset, int length)
void
storeStringSingleValue(long typeId, long objectId, char[] chars)
void
storeStringSingleValue(long typeId, long objectId, char[] chars, int offset, int length)
void
storeStringSingleValue(long typeId, long objectId, String string)
void
storeStringValue(long binaryOffset, char[] chars)
void
storeStringValue(long binaryOffset, char[] chars, int offset, int length)
void
storeStringValue(long binaryOffset, String string)
static long
toBinaryListByteLengthOffset(long binaryListOffset)
static long
toBinaryListContentByteLength(long binaryListTotalByteLength)
static long
toBinaryListElementCountOffset(long binaryListOffset)
static long
toBinaryListElementsOffset(long binaryListOffset)
static long
toBinaryListTotalByteLength(long binaryListElementsByteLength)
static long
toEntityContentOffset(long entityOffset)
static <T> BinaryTypeHandler<T>
TypeHandler(Class<T> entityType, BinaryField<? super T>... binaryFields)
static <T> BinaryTypeHandler<T>
TypeHandler(Class<T> entityType, PersistenceTypeInstantiator<Binary,T> instantiator, BinaryField<? super T>... binaryFields)
void
update_booleans(boolean[] array)
void
update_booleans(long offset, boolean[] array)
void
update_bytes(byte[] array)
void
update_bytes(long offset, byte[] array)
void
update_chars(char[] array)
void
update_chars(long offset, char[] array)
void
update_doubles(double[] array)
void
update_doubles(long offset, double[] array)
void
update_floats(float[] array)
void
update_floats(long offset, float[] array)
void
update_ints(int[] array)
void
update_ints(long offset, int[] array)
void
update_longs(long[] array)
void
update_longs(long offset, long[] array)
void
update_shorts(long offset, short[] array)
void
update_shorts(short[] array)
void
updateArrayObjectReferences(long binaryListStartOffset, PersistenceLoadHandler handler, Object[] array, int arrayOffset, int arrayLength)
void
updateArrayObjectReferences1(long binaryListStartOffset, PersistenceLoadHandler handler, Object[] array)
void
updateFixedSize(Object instance, BinaryValueSetter[] setters, long[] memoryOffsets, PersistenceLoadHandler handler)
int
updateSizedArrayObjectReferences(long binaryOffset, PersistenceLoadHandler handler, Object[] array)
Updates the passed array up to the size defined by the binary data, returns the size.void
validateArrayLength(Object[] array, long headerOffset)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface one.microstream.persistence.binary.types.Chunk
clear, isEmpty, totalLength
-
Method Details
-
keyValueReferenceCount
public static long keyValueReferenceCount(long elementCount) -
keyValueBinaryLength
public static long keyValueBinaryLength() -
binaryListMinimumLength
public static long binaryListMinimumLength() -
binaryListMaximumLength
public static long binaryListMaximumLength() -
toBinaryListTotalByteLength
public static long toBinaryListTotalByteLength(long binaryListElementsByteLength) -
toBinaryListContentByteLength
public static long toBinaryListContentByteLength(long binaryListTotalByteLength) -
lengthLength
public static int lengthLength()- Returns:
- the length in bytes of a persistent item's length field (8 bytes).
-
isValidGapLength
public static boolean isValidGapLength(long gapLength) -
isValidEntityLength
public static boolean isValidEntityLength(long entityLength) -
entityHeaderLength
public static int entityHeaderLength() -
entityTotalLength
public static long entityTotalLength(long entityContentLength) -
entityContentLength
public static long entityContentLength(long entityTotalLength) -
toEntityContentOffset
public static long toEntityContentOffset(long entityOffset) -
toBinaryListByteLengthOffset
public static final long toBinaryListByteLengthOffset(long binaryListOffset) -
toBinaryListElementCountOffset
public static final long toBinaryListElementCountOffset(long binaryListOffset) -
toBinaryListElementsOffset
public static long toBinaryListElementsOffset(long binaryListOffset) -
objectIdByteLength
public static int objectIdByteLength() -
referenceBinaryLength
public static long referenceBinaryLength(long referenceCount) -
calculateReferenceListTotalBinaryLength
public static long calculateReferenceListTotalBinaryLength(long count) -
calculateStringListContentBinaryLength
-
calculateBinaryLengthChars
public static long calculateBinaryLengthChars(long count) -
getEntityLengthRawValue
public static final long getEntityLengthRawValue(long entityAddress) -
getEntityTypeIdRawValue
public static final long getEntityTypeIdRawValue(long entityAddress) -
getEntityObjectIdRawValue
public static final long getEntityObjectIdRawValue(long entityAddress) -
buffers
-
isSwitchedByteOrder
public boolean isSwitchedByteOrder() -
getBuildItemTotalLength
public final long getBuildItemTotalLength() -
getBuildItemContentLength
public final long getBuildItemContentLength() -
getBuildItemTypeId
public final long getBuildItemTypeId() -
getBuildItemObjectId
public final long getBuildItemObjectId() -
storeEntityHeader
public abstract void storeEntityHeader(long entityContentLength, long entityTypeId, long entityObjectId) -
getListElementCountKeyValue
public final long getListElementCountKeyValue(long listStartOffset) -
read_byte
public final byte read_byte(long offset) -
read_boolean
public final boolean read_boolean(long offset) -
read_short
public final short read_short(long offset) -
read_char
public final char read_char(long offset) -
read_int
public final int read_int(long offset) -
read_float
public final float read_float(long offset) -
read_long
public final long read_long(long offset) -
read_double
public final double read_double(long offset) -
channelChunk
-
channelCount
public abstract int channelCount() -
iterateChannelChunks
-
iterateEntityData
-
storeKeyValuesAsEntries
public final void storeKeyValuesAsEntries(long typeId, long objectId, long headerOffset, Iterable<? extends KeyValue<?,?>> keyValues, long size, PersistenceFunction persister) -
storeMapEntrySet
public final <K, V> void storeMapEntrySet(long typeId, long objectId, long headerOffset, Set<Map.Entry<K,V>> entrySet, PersistenceFunction persister) -
storeSizedArray
public final void storeSizedArray(long tid, long oid, long headerOffset, Object[] array, int size, PersistenceFunction persister) -
storeSizedArray
public final void storeSizedArray(long tid, long oid, long headerOffset, Object[] array, int offset, int size, PersistenceFunction persister) -
storeRoots
public final void storeRoots(long typeId, long objectId, XGettingTable<String,Object> entries, PersistenceFunction persister) -
buildRootMapping
-
storeIterableAsList
public final void storeIterableAsList(long tid, long oid, long headerOffset, Iterable<?> elements, long size, PersistenceFunction persister) -
getSizedArrayElementCount
public int getSizedArrayElementCount(long headerOffset) -
getSizedArrayLength
public final int getSizedArrayLength(long sizedArrayOffset) -
getSizedArrayElementsAddress
public final long getSizedArrayElementsAddress(long headerOffset) -
validateArrayLength
-
getBinaryListTotalByteLength
public final long getBinaryListTotalByteLength(long listOffset) -
getLoadItemAvailableContentLength
public final long getLoadItemAvailableContentLength() -
getBinaryListElementCountValidating
public final long getBinaryListElementCountValidating(long listOffset, long elementLength) -
getBinaryListElementCountUnvalidating
public final long getBinaryListElementCountUnvalidating(long listOffset) -
getListElementCount
public final long getListElementCount(long listStartOffset, int elementLength) -
getListElementCountReferences
public final long getListElementCountReferences(long listStartOffset) -
iterateListStructureElements
Iterates over all elements of a binary list. All elements must have the same binary length.- Parameters:
listOffset
- the binary offset at which the binary list (actually: its header) startsreader
- the reader logic to be used by the iteration.- Returns:
- the element count that has been iterated.
-
iterateListElementReferences
public final void iterateListElementReferences(long listOffset, PersistenceObjectIdAcceptor iterator) -
iterateSizedArrayElementReferences
public final void iterateSizedArrayElementReferences(long offset, PersistenceObjectIdAcceptor iterator) -
iterateListStructureReferenceRange
public final void iterateListStructureReferenceRange(long listOffset, int referencesPerElement, PersistenceObjectIdAcceptor iterator) -
iterateListStructureCompositeElements
public static void iterateListStructureCompositeElements(Binary data, long elementsListOffset, int elementReferencesOffset, int elementReferenceCount, int elementTrailingBytes, PersistenceReferenceLoader iterator)Usage example:
For an entity solely consisting of a list of elements with each (2 ints, 1 float, 1 reference), call:
iterateReferences(data, 0, 12, 1, 0, iterator)
.
(2*4 bytes + 1*4 bytes, 1 reference, no trailing bytes)For an entity solely consisting of a list of elements with each (1 ints, 3 reference, 1 short), call:
iterateReferences(data, 0, 4, 3, 2, iterator)
.
(1*4 bytes, 3 references, 1*2 trailing bytes)- Parameters:
data
- theBinary
instance to read the data from.elementsListOffset
- the offset in bytes where the elements list is located in the whole entity.elementReferencesOffset
- the offset in bytes where the references are located in each element.elementReferenceCount
- the amount of references in each element.elementTrailingBytes
- the number of bytes after the references in each element.iterator
- the iterator to process the reference ids.
-
iterateKeyValueEntriesReferences
public final void iterateKeyValueEntriesReferences(long listOffset, PersistenceObjectIdAcceptor iterator) -
iterateReferenceRange
public final void iterateReferenceRange(long startOffset, long boundOffset, PersistenceObjectIdAcceptor iterator) -
iterateReferenceRangeUnvalidated
public final void iterateReferenceRangeUnvalidated(long startOffset, long boundOffset, PersistenceObjectIdAcceptor iterator) -
store_bytes
public final void store_bytes(long typeId, long objectId, byte[] array) -
store_booleans
public final void store_booleans(long typeId, long objectId, boolean[] array) -
store_shorts
public final void store_shorts(long typeId, long objectId, short[] array) -
store_chars
public final void store_chars(long typeId, long objectId, char[] array) -
store_ints
public final void store_ints(long typeId, long objectId, int[] array) -
store_floats
public final void store_floats(long typeId, long objectId, float[] array) -
store_longs
public final void store_longs(long typeId, long objectId, long[] array) -
store_doubles
public final void store_doubles(long typeId, long objectId, double[] array) -
storeByte
public final void storeByte(long typeId, long objectId, byte value) -
storeBoolean
public final void storeBoolean(long typeId, long objectId, boolean value) -
storeShort
public final void storeShort(long typeId, long objectId, short value) -
storeCharacter
public final void storeCharacter(long typeId, long objectId, char value) -
storeInteger
public final void storeInteger(long typeId, long objectId, int value) -
storeFloat
public final void storeFloat(long typeId, long objectId, float value) -
storeLong
public final void storeLong(long typeId, long objectId, long value) -
storeDouble
public final void storeDouble(long typeId, long objectId, double value) -
storeStateless
public final void storeStateless(long typeId, long objectId) -
storeStringSingleValue
-
storeStringSingleValue
public final void storeStringSingleValue(long typeId, long objectId, char[] chars) -
storeStringSingleValue
public final void storeStringSingleValue(long typeId, long objectId, char[] chars, int offset, int length) -
storeStringValue
-
storeStringValue
public final void storeStringValue(long binaryOffset, char[] chars) -
storeStringValue
public final void storeStringValue(long binaryOffset, char[] chars, int offset, int length) -
storeReferences
public final void storeReferences(long typeId, long objectId, long binaryOffset, PersistenceFunction persister, Object[] array) -
storeReferences
public final void storeReferences(long typeId, long objectId, long binaryOffset, PersistenceFunction persister, Object[] array, int arrayOffset, int arrayLength) -
storeFixedSize
public final void storeFixedSize(PersistenceStoreHandler<Binary> handler, long contentLength, long typeId, long objectId, Object instance, long[] memoryOffsets, BinaryValueStorer[] storers) -
buildStrings
-
buildByte
-
buildByte
-
buildBoolean
-
buildBoolean
-
buildShort
-
buildShort
-
buildCharacter
-
buildCharacter
-
buildInteger
-
buildInteger
-
buildFloat
-
buildFloat
-
buildLong
-
buildLong
-
buildDouble
-
buildDouble
-
buildPrimitiveWrapper
-
buildPrimitiveWrapper
-
buildString
-
buildString
-
create_bytes
public final byte[] create_bytes() -
create_bytes
public final byte[] create_bytes(long listOffset) -
create_booleans
public final boolean[] create_booleans() -
create_booleans
public final boolean[] create_booleans(long listOffset) -
create_shorts
public final short[] create_shorts() -
create_shorts
public final short[] create_shorts(long listOffset) -
create_chars
public final char[] create_chars() -
create_chars
public final char[] create_chars(long listOffset) -
create_ints
public final int[] create_ints() -
create_ints
public final int[] create_ints(long listOffset) -
create_floats
public final float[] create_floats() -
create_floats
public final float[] create_floats(long listOffset) -
create_longs
public final long[] create_longs() -
create_longs
public final long[] create_longs(long listOffset) -
create_doubles
public final double[] create_doubles() -
create_doubles
public final double[] create_doubles(long listOffset) -
build_bytes
public final byte[] build_bytes() -
build_bytes
public final byte[] build_bytes(long listOffset) -
build_booleans
public final boolean[] build_booleans() -
build_booleans
public final boolean[] build_booleans(long listOffset) -
build_shorts
public final short[] build_shorts() -
build_shorts
public final short[] build_shorts(long listOffset) -
build_chars
public final char[] build_chars() -
build_chars
public final char[] build_chars(long listOffset) -
build_ints
public final int[] build_ints() -
build_ints
public final int[] build_ints(long listOffset) -
build_floats
public final float[] build_floats() -
build_floats
public final float[] build_floats(long listOffset) -
build_longs
public final long[] build_longs() -
build_longs
public final long[] build_longs(long listOffset) -
build_doubles
public final double[] build_doubles() -
build_doubles
public final double[] build_doubles(long listOffset) -
collectElementsIntoArray
public final void collectElementsIntoArray(long binaryOffset, PersistenceLoadHandler handler, Object[] target) -
collectListObjectReferences
public final int collectListObjectReferences(long binaryOffset, PersistenceLoadHandler handler, Consumer<Object> collector) -
collectObjectReferences
public final void collectObjectReferences(long binaryOffset, int length, PersistenceLoadHandler handler, Consumer<Object> collector) -
collectKeyValueReferences
public final int collectKeyValueReferences(long binaryOffset, int length, PersistenceLoadHandler handler, BiConsumer<Object,Object> collector) -
iterateReferences
public abstract long iterateReferences(BinaryReferenceTraverser[] traversers, PersistenceObjectIdAcceptor acceptor) -
mark
public abstract void mark() -
reset
public abstract void reset() -
storeCharsAsList
public final long storeCharsAsList(long memoryOffset, char[] chars, int offset, int length) -
copyMemory
public final void copyMemory(ByteBuffer directByteBuffer, long offset, BinaryValueSetter[] setters, long[] targetOffsets) -
storeListHeader
public final void storeListHeader(long offset, long elementsBinaryLength, long elementsCount) -
storeIterableContentAsList
public final void storeIterableContentAsList(long offset, PersistenceFunction persister, Iterable<?> elements, long elementCount) -
storeStringsAsList
public final void storeStringsAsList(long memoryOffset, long precalculatedContentBinaryLength, String[] strings) -
storeStringsAsList
public final void storeStringsAsList(long memoryOffset, long precalculatedContentBinaryLength, String[] strings, int offset, int length) -
storeKeyValuesAsEntries
public final void storeKeyValuesAsEntries(long offset, PersistenceFunction persister, Iterable<? extends KeyValue<?,?>> elements, long elementCount) -
storeReferencesAsList
public final void storeReferencesAsList(long memoryOffset, PersistenceFunction persister, Object[] array, int offset, int length) -
store_byte
public final void store_byte(long offset, byte value) -
store_boolean
public final void store_boolean(long offset, boolean value) -
store_short
public final void store_short(long offset, short value) -
store_char
public final void store_char(long offset, char value) -
store_int
public final void store_int(long offset, int value) -
store_float
public final void store_float(long offset, float value) -
store_long
public final void store_long(long offset, long value) -
store_double
public final void store_double(long offset, double value) -
store_byte
public final void store_byte(byte value) -
store_boolean
public final void store_boolean(boolean value) -
store_short
public final void store_short(short value) -
store_char
public final void store_char(char value) -
store_int
public final void store_int(int value) -
store_float
public final void store_float(float value) -
store_long
public final void store_long(long value) -
store_double
public final void store_double(double value) -
isDummyItem
protected final boolean isDummyItem() -
isProper
protected final boolean isProper() -
modifyLoadItem
public abstract void modifyLoadItem(ByteBuffer directByteBuffer, long offset, long entityTotalLength, long entityTypeId, long entityObjectId) -
updateFixedSize
public final void updateFixedSize(Object instance, BinaryValueSetter[] setters, long[] memoryOffsets, PersistenceLoadHandler handler) -
updateSizedArrayObjectReferences
public final int updateSizedArrayObjectReferences(long binaryOffset, PersistenceLoadHandler handler, Object[] array)Updates the passed array up to the size defined by the binary data, returns the size.- Parameters:
binaryOffset
- the offset of the array size in the binary datahandler
- the persistence load handlerarray
- the array to update- Returns:
- the array size
-
updateArrayObjectReferences1
public final void updateArrayObjectReferences1(long binaryListStartOffset, PersistenceLoadHandler handler, Object[] array) -
updateArrayObjectReferences
public final void updateArrayObjectReferences(long binaryListStartOffset, PersistenceLoadHandler handler, Object[] array, int arrayOffset, int arrayLength) -
update_bytes
public final void update_bytes(byte[] array) -
update_bytes
public final void update_bytes(long offset, byte[] array) -
update_booleans
public final void update_booleans(boolean[] array) -
update_booleans
public final void update_booleans(long offset, boolean[] array) -
update_shorts
public final void update_shorts(short[] array) -
update_shorts
public final void update_shorts(long offset, short[] array) -
update_chars
public final void update_chars(char[] array) -
update_chars
public final void update_chars(long offset, char[] array) -
update_ints
public final void update_ints(int[] array) -
update_ints
public final void update_ints(long offset, int[] array) -
update_floats
public final void update_floats(float[] array) -
update_floats
public final void update_floats(long offset, float[] array) -
update_longs
public final void update_longs(long[] array) -
update_longs
public final void update_longs(long offset, long[] array) -
update_doubles
public final void update_doubles(double[] array) -
update_doubles
public final void update_doubles(long offset, double[] array) -
registerHelper
Helper instances can be used as temporary additional state for the duration of the building process. E.g.: JDK hash collections cannot properly collect elements during the building process as the element instances might still be in an initialized state without their proper data, so hashing and equality comparisons would fail or result in all elements being "equal". So building JDK hash collections required to pre-collect their elements in an additional helper structure and defer the actual elements collecting to the completion.Similar problems with other or complex custom handlers are conceivable.
Only one helper object can be registered per subject instance (the instance to be built).
- Parameters:
key
- the object to register the helper forhelper
- the helper to register
-
getHelper
Helper instances can be used as temporary additional state for the duration of the building process. E.g.: JDK hash collections cannot properly collect elements during the building process as the element instances might still be in an initialized state without their proper data, so hashing and equality comparisons would fail or result in all elements being "equal". So building JDK hash collections required to pre-collect their elements in an additional helper structure and defer the actual elements collecting to the completion.Similar problems with other or complex custom handlers are conceivable.
- Parameters:
key
- the object to get the helper for- Returns:
- the registered helper, or
null
if none is registered for the key object
-
Field_byte
-
Field_byte
public static final <T> BinaryField<T> Field_byte(String name, Getter_byte<T> getter, Setter_byte<T> setter) -
Field_boolean
-
Field_boolean
public static final <T> BinaryField<T> Field_boolean(String name, Getter_boolean<T> getter, Setter_boolean<T> setter) -
Field_short
-
Field_short
public static final <T> BinaryField<T> Field_short(String name, Getter_short<T> getter, Setter_short<T> setter) -
Field_char
-
Field_char
public static final <T> BinaryField<T> Field_char(String name, Getter_char<T> getter, Setter_char<T> setter) -
Field_int
-
Field_int
public static final <T> BinaryField<T> Field_int(String name, Getter_int<T> getter, Setter_int<T> setter) -
Field_float
-
Field_float
public static final <T> BinaryField<T> Field_float(String name, Getter_float<T> getter, Setter_float<T> setter) -
Field_long
-
Field_long
public static final <T> BinaryField<T> Field_long(String name, Getter_long<T> getter, Setter_long<T> setter) -
Field_double
-
Field_double
public static final <T> BinaryField<T> Field_double(String name, Getter_double<T> getter, Setter_double<T> setter) -
Field
public static final <T, R> BinaryField<T> Field(Class<R> referenceType, String name, Getter<T,R> getter) -
Field
public static final <T, R> BinaryField<T> Field(Class<R> referenceType, String name, Getter<T,R> getter, Setter<T,R> setter) -
TypeHandler
@SafeVarargs public static <T> BinaryTypeHandler<T> TypeHandler(Class<T> entityType, BinaryField<? super T>... binaryFields) -
TypeHandler
@SafeVarargs public static <T> BinaryTypeHandler<T> TypeHandler(Class<T> entityType, PersistenceTypeInstantiator<Binary,T> instantiator, BinaryField<? super T>... binaryFields)
-