io.deephaven.chunk.ResettableChunkChunk Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-chunk Show documentation
Show all versions of deephaven-engine-chunk Show documentation
Engine Chunks: Array-like data structures for dense, efficient data movement
The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.chunk;
import io.deephaven.chunk.attributes.Any;
/**
* {@link ChunkChunk} that may have its backing storage reset to a slice of that belonging to another {@link ChunkChunk}
* or a native array.
*/
public interface ResettableChunkChunk extends ChunkChunk {
/**
* Reset the data and bounds of this chunk to a range or sub-range of the specified {@link ChunkChunk}.
*
* @param other The other {@link ChunkChunk}
* @param offset The offset into other
* @param capacity The capacity this should have after reset
*/
void resetFromChunk(ChunkChunk other, int offset, int capacity);
/**
* Reset the data and bounds of this chunk to a range or sub-range of the specified array.
*
* @param array The array
* @param offset The offset into array
* @param capacity The capacity this should have after reset
*/
void resetFromArray(Object array, int offset, int capacity);
default ResettableByteChunkChunk asResettableByteChunkChunk() {
return (ResettableByteChunkChunk) this;
}
default ResettableBooleanChunkChunk asResettableBooleanChunkChunk() {
return (ResettableBooleanChunkChunk) this;
}
default ResettableCharChunkChunk asResettableCharChunkChunk() {
return (ResettableCharChunkChunk) this;
}
default ResettableShortChunkChunk asResettableShortChunkChunk() {
return (ResettableShortChunkChunk) this;
}
default ResettableIntChunkChunk asResettableIntChunkChunk() {
return (ResettableIntChunkChunk) this;
}
default ResettableLongChunkChunk asResettableLongChunkChunk() {
return (ResettableLongChunkChunk) this;
}
default ResettableFloatChunkChunk asResettableFloatChunkChunk() {
return (ResettableFloatChunkChunk) this;
}
default ResettableDoubleChunkChunk asResettableDoubleChunkChunk() {
return (ResettableDoubleChunkChunk) this;
}
default ResettableObjectChunkChunk asResettableObjectChunkChunk() {
return (ResettableObjectChunkChunk) this;
}
}