io.deephaven.chunk.ResettableWritableShortChunkChunk 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
//
// ****** AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY
// ****** Edit ResettableWritableCharChunkChunk and run "./gradlew replicateSourcesAndChunks" to regenerate
//
// @formatter:off
package io.deephaven.chunk;
import io.deephaven.chunk.attributes.Any;
public class ResettableWritableShortChunkChunk extends WritableShortChunkChunk
implements ResettableWritableChunkChunk {
public static ResettableWritableShortChunkChunk makeResettableChunk() {
return new ResettableWritableShortChunkChunk<>();
}
private ResettableWritableShortChunkChunk(WritableShortChunk[] data, int offset, int capacity) {
super(data, offset, capacity);
}
private ResettableWritableShortChunkChunk() {
this(WritableShortChunk.getEmptyChunkArray(), 0, 0);
}
@Override
public ResettableWritableShortChunkChunk slice(int offset, int capacity) {
ChunkHelpers.checkSliceArgs(size, offset, capacity);
return new ResettableWritableShortChunkChunk<>(writableData, this.offset + offset, capacity);
}
@Override
public final void resetFromChunk(WritableChunkChunk other, int offset, int capacity) {
resetFromTypedChunk(other.asWritableShortChunkChunk(), offset, capacity);
}
@Override
public final void resetFromArray(Object array, int offset, int capacity) {
// noinspection unchecked
final WritableShortChunk[] typedArray = (WritableShortChunk[]) array;
resetFromTypedArray(typedArray, offset, capacity);
}
public final void resetFromTypedChunk(WritableShortChunkChunk other, int offset, int capacity) {
ChunkHelpers.checkSliceArgs(other.size, offset, capacity);
resetFromTypedArray(other.writableData, other.offset + offset, capacity);
}
public final void resetFromTypedArray(WritableShortChunk[] data, int offset, int capacity) {
ChunkHelpers.checkArrayArgs(data.length, offset, capacity);
final int oldCapacity = this.capacity;
this.data = data;
this.writableData = data;
this.offset = offset;
this.capacity = capacity;
this.size = capacity;
resetInnerCache(data, offset, oldCapacity, capacity);
}
}