All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.chunk.ResettableShortChunkChunk Maven / Gradle / Ivy

The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
// ****** AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY
// ****** Edit ResettableCharChunkChunk and run "./gradlew replicateSourcesAndChunks" to regenerate
//
// @formatter:off
package io.deephaven.chunk;

import io.deephaven.chunk.attributes.Any;

public class ResettableShortChunkChunk extends ShortChunkChunk
        implements ResettableChunkChunk {

    public static  ResettableShortChunkChunk makeResettableChunk() {
        return new ResettableShortChunkChunk<>();
    }

    private ResettableShortChunkChunk(ShortChunk[] data, int offset, int capacity) {
        super(data, offset, capacity);
    }

    private ResettableShortChunkChunk() {
        this(ShortChunk.getEmptyChunkArray(), 0, 0);
    }

    @Override
    public ResettableShortChunkChunk slice(int offset, int capacity) {
        ChunkHelpers.checkSliceArgs(size, offset, capacity);
        return new ResettableShortChunkChunk<>(data, this.offset + offset, capacity);
    }

    @Override
    public final void resetFromChunk(ChunkChunk other, int offset, int capacity) {
        resetFromTypedChunk(other.asShortChunkChunk(), offset, capacity);
    }

    @Override
    public final void resetFromArray(Object array, int offset, int capacity) {
        // noinspection unchecked
        final ShortChunk[] typedArray = (ShortChunk[]) array;
        resetFromTypedArray(typedArray, offset, capacity);
    }

    public final void resetFromTypedChunk(ShortChunkChunk other, int offset, int capacity) {
        ChunkHelpers.checkSliceArgs(other.size, offset, capacity);
        resetFromTypedArray(other.data, other.offset + offset, capacity);
    }

    public final void resetFromTypedArray(ShortChunk[] data, int offset, int capacity) {
        ChunkHelpers.checkArrayArgs(data.length, offset, capacity);
        this.data = data;
        this.offset = offset;
        this.capacity = capacity;
        this.size = capacity;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy