Interface IChunkFloat
- All Superinterfaces:
IArray,IArrayReader,IArrayWriter,IChunk<Float>,IMemoryMonitored,IWritableArray
- All Known Implementing Classes:
ArrayChunkFloat,ArrayChunkFloatNullable,BufferChunkFloat,BufferChunkFloatNullable,ChunkSingleFloat,DirectChunkFloat,DirectChunkFloatNullable,FrequentFloatChunk,FrequentNullFloatChunk,NullableFrequentFloatChunk
Specialized primitive read operations access the physical storage directly and ignore null
checks, so when dealing with implementations that support null values, the IArrayReader.isNull(int)
method must be called before reading the value.
Implementations must override the readFloat(int) and writeFloat(int, float)
methods that are used in all default implementations within this interface.
- Author:
- ActiveViam
-
Field Summary
Fields inherited from interface com.qfs.chunk.IChunk
NO_SIZE_LIMIT -
Method Summary
Modifier and TypeMethodDescriptiondefault voidcopyInto(int position, IWritableCell cell) Copies the value at a given position in this chunk into the provided cell.default IFrequentValueChunk<Float>createFrequentValueChunk(int chunkSize, Float frequentValue, IChunk<Float> underlyingChunk, IRowMapping mapping, boolean hasNullValues) Creates a compressed version of this chunk using frequency compression.booleanequals(int position, float value) Tests if the record stored at that position is equal to a value.default voidfill(float value) Fills all slots in the chunk with the same value.default intGets the type for binding transfers of this chunk.default booleanReturns whether this chunk contains primitive data, as perTypes.isPrimitive(int).read(int position) Returns the data stored at that position in the chunk.doublereadDouble(int position) Reads a double primitive value from the array.floatreadFloat(int position) Reads a float primitive value from the array.default voidtransfer(IWritableTable destination, int destinationColumn, int[] rowsMapping, int numRows) Transfers a given number of rows from this chunk to target rows in the given column of the destinationtable.voidWrites a piece of data at a position in the array.voidwriteFloat(int position, float value) Writes a float primitive value in the array.default voidwriteFromCell(int position, IReadableCell cell) Writes the content of the cell into the chunk at the given position.voidwriteInt(int position, int value) Writes an int primitive value in the array.voidwriteLong(int position, long value) Writes a long primitive value in the array.Methods inherited from interface com.qfs.chunk.IArrayReader
isNull, readBoolean, readInt, readLong, readVectorMethods inherited from interface com.qfs.chunk.IArrayWriter
addDouble, addFloat, addInt, addLong, writeBoolean, writeDoubleMethods inherited from interface com.qfs.chunk.IChunk
capacity, compress, createArrayCursor, destroy, findRowsEqualTo, findRowsEqualTo, findRowsEqualTo, findRowsInSet, findRowsInSet, findRowsInSet, findRowsInTransactionEqualTo, findRowsInTransactionEqualTo, findRowsInTransactionEqualTo, findRowsInTransactionInSet, findRowsInTransactionInSet, findRowsInTransactionInSet, freeRow, getChunkCreatorForSparse, getChunkId, getChunkType, getPhysicalSize, isDead, localRow, replaceBy, reset, sparseChunkCompressionMethods inherited from interface com.qfs.monitoring.memory.IMemoryMonitored
getMemoryStatistic
-
Method Details
-
isPrimitive
default boolean isPrimitive()Description copied from interface:IChunkReturns whether this chunk contains primitive data, as perTypes.isPrimitive(int).- Specified by:
isPrimitivein interfaceIChunk<Float>- Returns:
trueif this chunk contains primitive data, as perTypes.isPrimitive(int),falseotherwise
-
getBindingType
default int getBindingType()Description copied from interface:IChunkGets the type for binding transfers of this chunk.- Specified by:
getBindingTypein interfaceIChunk<Float>- Returns:
- the physical type like
Types.PHYSICAL_INT, etc
-
writeFromCell
Description copied from interface:IChunkWrites the content of the cell into the chunk at the given position.It is up to chunks to use the appropriate read method to avoid boxing as much as possible.
- Specified by:
writeFromCellin interfaceIChunk<Float>
-
fill
default void fill(float value) Fills all slots in the chunk with the same value.- Parameters:
value- the value to fill the chunk with
-
equals
boolean equals(int position, float value) Tests if the record stored at that position is equal to a value.- Parameters:
position- the position to readvalue- the value to compare- Returns:
trueif the read value is the same as the given value,falseotherwise
-
read
Description copied from interface:IChunkReturns the data stored at that position in the chunk.- Specified by:
readin interfaceIArrayReader- Specified by:
readin interfaceIChunk<Float>- Parameters:
position- the position in the chunk at which to read- Returns:
- the data stored at that position in the chunk
-
readFloat
float readFloat(int position) Description copied from interface:IArrayReaderReads a float primitive value from the array.An exception is thrown if the value is not of the right type.
- Specified by:
readFloatin interfaceIArrayReader- Parameters:
position- 0-based index in an array- Returns:
- float value
-
readDouble
double readDouble(int position) Description copied from interface:IArrayReaderReads a double primitive value from the array.An exception is thrown if the value is not of the right type.
- Specified by:
readDoublein interfaceIArrayReader- Parameters:
position- 0-based index in an array- Returns:
- double value
-
write
Description copied from interface:IArrayWriterWrites a piece of data at a position in the array.For better performance, use the primitive type operations.
- Specified by:
writein interfaceIArrayWriter- Parameters:
position- 0-based index in the arrayvalue- the value to write
-
writeInt
void writeInt(int position, int value) Description copied from interface:IArrayWriterWrites an int primitive value in the array.- Specified by:
writeIntin interfaceIArrayWriter- Parameters:
position- 0-based index in the arrayvalue- the value to write
-
writeLong
void writeLong(int position, long value) Description copied from interface:IArrayWriterWrites a long primitive value in the array.- Specified by:
writeLongin interfaceIArrayWriter- Parameters:
position- 0-based index in the arrayvalue- the value to write
-
writeFloat
void writeFloat(int position, float value) Description copied from interface:IArrayWriterWrites a float primitive value in the array.- Specified by:
writeFloatin interfaceIArrayWriter- Parameters:
position- 0-based index in the arrayvalue- the value to write
-
copyInto
Description copied from interface:IChunkCopies the value at a given position in this chunk into the provided cell. -
transfer
default void transfer(IWritableTable destination, int destinationColumn, int[] rowsMapping, int numRows) Description copied from interface:IChunkTransfers a given number of rows from this chunk to target rows in the given column of the destinationtable.The mapping from the source rows to the target rows is described with an array of
2*nslots. Each even slot contains the index of the row to be copied from the source chunk and the following odd slot contains the index of the row into which the source data will be transferred. -
createFrequentValueChunk
default IFrequentValueChunk<Float> createFrequentValueChunk(int chunkSize, Float frequentValue, IChunk<Float> underlyingChunk, IRowMapping mapping, boolean hasNullValues) Description copied from interface:IChunkCreates a compressed version of this chunk using frequency compression.- Specified by:
createFrequentValueChunkin interfaceIChunk<Float>- Parameters:
chunkSize- visible size of the compressed chunkunderlyingChunk- underlying chunk containing values different from the frequent valuemapping- mapping liking visible rows to each non-frequent valuehasNullValues- flag indicating if the underlying chunk contains null values.- See Also:
-