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 longbinaryListMaximumLength()static longbinaryListMinimumLength()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)BooleanbuildBoolean()BooleanbuildBoolean(long offset)BytebuildByte()BytebuildByte(long offset)CharacterbuildCharacter()CharacterbuildCharacter(long offset)DoublebuildDouble()DoublebuildDouble(long offset)FloatbuildFloat()FloatbuildFloat(long offset)IntegerbuildInteger()IntegerbuildInteger(long offset)LongbuildLong()LongbuildLong(long offset)ObjectbuildPrimitiveWrapper(Class<?> primitiveValueType)ObjectbuildPrimitiveWrapper(Class<?> primitiveValueType, long offset)<T extends XAddingMap<String, Long>>
TbuildRootMapping(T mapping)ShortbuildShort()ShortbuildShort(long offset)StringbuildString()StringbuildString(long offset)String[]buildStrings(long stringsListOffset)static longcalculateBinaryLengthChars(long count)static longcalculateReferenceListTotalBinaryLength(long count)static longcalculateStringListContentBinaryLength(String[] strings)abstract BinarychannelChunk(int channelIndex)abstract intchannelCount()voidcollectElementsIntoArray(long binaryOffset, PersistenceLoadHandler handler, Object[] target)intcollectKeyValueReferences(long binaryOffset, int length, PersistenceLoadHandler handler, BiConsumer<Object,Object> collector)intcollectListObjectReferences(long binaryOffset, PersistenceLoadHandler handler, Consumer<Object> collector)voidcollectObjectReferences(long binaryOffset, int length, PersistenceLoadHandler handler, Consumer<Object> collector)voidcopyMemory(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 longentityContentLength(long entityTotalLength)static intentityHeaderLength()static longentityTotalLength(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)longgetBinaryListElementCountUnvalidating(long listOffset)longgetBinaryListElementCountValidating(long listOffset, long elementLength)longgetBinaryListTotalByteLength(long listOffset)longgetBuildItemContentLength()longgetBuildItemObjectId()longgetBuildItemTotalLength()longgetBuildItemTypeId()static longgetEntityLengthRawValue(long entityAddress)static longgetEntityObjectIdRawValue(long entityAddress)static longgetEntityTypeIdRawValue(long entityAddress)ObjectgetHelper(Object key)Helper instances can be used as temporary additional state for the duration of the building process.longgetListElementCount(long listStartOffset, int elementLength)longgetListElementCountKeyValue(long listStartOffset)longgetListElementCountReferences(long listStartOffset)longgetLoadItemAvailableContentLength()intgetSizedArrayElementCount(long headerOffset)longgetSizedArrayElementsAddress(long headerOffset)intgetSizedArrayLength(long sizedArrayOffset)protected booleanisDummyItem()protected booleanisProper()booleanisSwitchedByteOrder()static booleanisValidEntityLength(long entityLength)static booleanisValidGapLength(long gapLength)abstract voiditerateChannelChunks(Consumer<? super Binary> logic)abstract voiditerateEntityData(BinaryEntityDataReader reader)voiditerateKeyValueEntriesReferences(long listOffset, PersistenceObjectIdAcceptor iterator)voiditerateListElementReferences(long listOffset, PersistenceObjectIdAcceptor iterator)static voiditerateListStructureCompositeElements(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)longiterateListStructureElements(long listOffset, BinaryElementReader reader)Iterates over all elements of a binary list.voiditerateListStructureReferenceRange(long listOffset, int referencesPerElement, PersistenceObjectIdAcceptor iterator)voiditerateReferenceRange(long startOffset, long boundOffset, PersistenceObjectIdAcceptor iterator)voiditerateReferenceRangeUnvalidated(long startOffset, long boundOffset, PersistenceObjectIdAcceptor iterator)abstract longiterateReferences(BinaryReferenceTraverser[] traversers, PersistenceObjectIdAcceptor acceptor)voiditerateSizedArrayElementReferences(long offset, PersistenceObjectIdAcceptor iterator)static longkeyValueBinaryLength()static longkeyValueReferenceCount(long elementCount)static intlengthLength()abstract voidmodifyLoadItem(ByteBuffer directByteBuffer, long offset, long entityTotalLength, long entityTypeId, long entityObjectId)static intobjectIdByteLength()booleanread_boolean(long offset)byteread_byte(long offset)charread_char(long offset)doubleread_double(long offset)floatread_float(long offset)intread_int(long offset)longread_long(long offset)shortread_short(long offset)static longreferenceBinaryLength(long referenceCount)voidregisterHelper(Object key, Object helper)Helper instances can be used as temporary additional state for the duration of the building process.voidstore_boolean(boolean value)voidstore_boolean(long offset, boolean value)voidstore_booleans(long typeId, long objectId, boolean[] array)voidstore_byte(byte value)voidstore_byte(long offset, byte value)voidstore_bytes(long typeId, long objectId, byte[] array)voidstore_char(char value)voidstore_char(long offset, char value)voidstore_chars(long typeId, long objectId, char[] array)voidstore_double(double value)voidstore_double(long offset, double value)voidstore_doubles(long typeId, long objectId, double[] array)voidstore_float(float value)voidstore_float(long offset, float value)voidstore_floats(long typeId, long objectId, float[] array)voidstore_int(int value)voidstore_int(long offset, int value)voidstore_ints(long typeId, long objectId, int[] array)voidstore_long(long value)voidstore_long(long offset, long value)voidstore_longs(long typeId, long objectId, long[] array)voidstore_short(long offset, short value)voidstore_short(short value)voidstore_shorts(long typeId, long objectId, short[] array)voidstoreBoolean(long typeId, long objectId, boolean value)voidstoreByte(long typeId, long objectId, byte value)voidstoreCharacter(long typeId, long objectId, char value)longstoreCharsAsList(long memoryOffset, char[] chars, int offset, int length)voidstoreDouble(long typeId, long objectId, double value)abstract voidstoreEntityHeader(long entityContentLength, long entityTypeId, long entityObjectId)voidstoreFixedSize(PersistenceStoreHandler<Binary> handler, long contentLength, long typeId, long objectId, Object instance, long[] memoryOffsets, BinaryValueStorer[] storers)voidstoreFloat(long typeId, long objectId, float value)voidstoreInteger(long typeId, long objectId, int value)voidstoreIterableAsList(long tid, long oid, long headerOffset, Iterable<?> elements, long size, PersistenceFunction persister)voidstoreIterableContentAsList(long offset, PersistenceFunction persister, Iterable<?> elements, long elementCount)voidstoreKeyValuesAsEntries(long typeId, long objectId, long headerOffset, Iterable<? extends KeyValue<?,?>> keyValues, long size, PersistenceFunction persister)voidstoreKeyValuesAsEntries(long offset, PersistenceFunction persister, Iterable<? extends KeyValue<?,?>> elements, long elementCount)voidstoreListHeader(long offset, long elementsBinaryLength, long elementsCount)voidstoreLong(long typeId, long objectId, long value)<K, V> voidstoreMapEntrySet(long typeId, long objectId, long headerOffset, Set<Map.Entry<K,V>> entrySet, PersistenceFunction persister)voidstoreReferences(long typeId, long objectId, long binaryOffset, PersistenceFunction persister, Object[] array)voidstoreReferences(long typeId, long objectId, long binaryOffset, PersistenceFunction persister, Object[] array, int arrayOffset, int arrayLength)voidstoreReferencesAsList(long memoryOffset, PersistenceFunction persister, Object[] array, int offset, int length)voidstoreRoots(long typeId, long objectId, XGettingTable<String,Object> entries, PersistenceFunction persister)voidstoreShort(long typeId, long objectId, short value)voidstoreSizedArray(long tid, long oid, long headerOffset, Object[] array, int offset, int size, PersistenceFunction persister)voidstoreSizedArray(long tid, long oid, long headerOffset, Object[] array, int size, PersistenceFunction persister)voidstoreStateless(long typeId, long objectId)voidstoreStringsAsList(long memoryOffset, long precalculatedContentBinaryLength, String[] strings)voidstoreStringsAsList(long memoryOffset, long precalculatedContentBinaryLength, String[] strings, int offset, int length)voidstoreStringSingleValue(long typeId, long objectId, char[] chars)voidstoreStringSingleValue(long typeId, long objectId, char[] chars, int offset, int length)voidstoreStringSingleValue(long typeId, long objectId, String string)voidstoreStringValue(long binaryOffset, char[] chars)voidstoreStringValue(long binaryOffset, char[] chars, int offset, int length)voidstoreStringValue(long binaryOffset, String string)static longtoBinaryListByteLengthOffset(long binaryListOffset)static longtoBinaryListContentByteLength(long binaryListTotalByteLength)static longtoBinaryListElementCountOffset(long binaryListOffset)static longtoBinaryListElementsOffset(long binaryListOffset)static longtoBinaryListTotalByteLength(long binaryListElementsByteLength)static longtoEntityContentOffset(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)voidupdate_booleans(boolean[] array)voidupdate_booleans(long offset, boolean[] array)voidupdate_bytes(byte[] array)voidupdate_bytes(long offset, byte[] array)voidupdate_chars(char[] array)voidupdate_chars(long offset, char[] array)voidupdate_doubles(double[] array)voidupdate_doubles(long offset, double[] array)voidupdate_floats(float[] array)voidupdate_floats(long offset, float[] array)voidupdate_ints(int[] array)voidupdate_ints(long offset, int[] array)voidupdate_longs(long[] array)voidupdate_longs(long offset, long[] array)voidupdate_shorts(long offset, short[] array)voidupdate_shorts(short[] array)voidupdateArrayObjectReferences(long binaryListStartOffset, PersistenceLoadHandler handler, Object[] array, int arrayOffset, int arrayLength)voidupdateArrayObjectReferences1(long binaryListStartOffset, PersistenceLoadHandler handler, Object[] array)voidupdateFixedSize(Object instance, BinaryValueSetter[] setters, long[] memoryOffsets, PersistenceLoadHandler handler)intupdateSizedArrayObjectReferences(long binaryOffset, PersistenceLoadHandler handler, Object[] array)Updates the passed array up to the size defined by the binary data, returns the size.voidvalidateArrayLength(Object[] array, long headerOffset)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 peristent 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- theBinaryinstance 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) -
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. -
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).
-
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 failt 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.
-
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)
-