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

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

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 ResettableWritableObjectChunkChunk extends WritableObjectChunkChunk
        implements ResettableWritableChunkChunk {

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

    private ResettableWritableObjectChunkChunk(WritableObjectChunk[] data, int offset, int capacity) {
        super(data, offset, capacity);
    }

    private ResettableWritableObjectChunkChunk() {
        this(WritableObjectChunk.getEmptyChunkArray(), 0, 0);
    }

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

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

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

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

    public final void resetFromTypedArray(WritableObjectChunk[] 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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy