io.deephaven.chunk.ResettableReadOnlyChunk 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;
import io.deephaven.chunk.util.pools.PoolableChunk;
/**
* {@link Chunk} that may have its backing storage reset to a slice of that belonging to another {@link Chunk} or a
* native array.
*/
public interface ResettableReadOnlyChunk extends ResettableChunk, PoolableChunk {
/**
* Reset the data and bounds of this chunk to a range or sub-range of the specified {@link Chunk}.
*
* @param other The other {@link Chunk}
* @param offset The offset into other
* @param capacity The capacity this should have after reset
*/
Chunk resetFromChunk(Chunk extends ATTR> other, int offset, int capacity);
@Override
default Chunk resetFromChunk(WritableChunk other, int offset, int capacity) {
return resetFromChunk((Chunk) other, offset, capacity);
}
@Override
Chunk resetFromArray(Object array, int offset, int capacity);
@Override
Chunk resetFromArray(Object array);
@Override
Chunk clear();
default ResettableByteChunk asResettableByteChunk() {
return (ResettableByteChunk) this;
}
default ResettableBooleanChunk asResettableBooleanChunk() {
return (ResettableBooleanChunk) this;
}
default ResettableCharChunk asResettableCharChunk() {
return (ResettableCharChunk) this;
}
default ResettableShortChunk asResettableShortChunk() {
return (ResettableShortChunk) this;
}
default ResettableIntChunk asResettableIntChunk() {
return (ResettableIntChunk) this;
}
default ResettableLongChunk asResettableLongChunk() {
return (ResettableLongChunk) this;
}
default ResettableFloatChunk asResettableFloatChunk() {
return (ResettableFloatChunk) this;
}
default ResettableDoubleChunk asResettableDoubleChunk() {
return (ResettableDoubleChunk) this;
}
default ResettableObjectChunk asResettableObjectChunk() {
return (ResettableObjectChunk) this;
}
}