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

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

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

import io.deephaven.chunk.attributes.Any;


public class WritableIntChunkChunk extends IntChunkChunk implements WritableChunkChunk {

    public static  WritableIntChunk[] makeArray(int capacity) {
        // noinspection unchecked
        return new WritableIntChunk[capacity];
    }

    public static  WritableIntChunkChunk makeWritableChunk(int size) {
        return writableChunkWrap(makeArray(size), 0, size);
    }

    public static  WritableIntChunkChunk writableChunkWrap(WritableIntChunk[] data) {
        return new WritableIntChunkChunk<>(data, 0, data.length);
    }

    public static  WritableIntChunkChunk writableChunkWrap(WritableIntChunk[] data,
            int offset, int size) {
        return new WritableIntChunkChunk<>(data, offset, size);
    }

    /**
     * alias of super.data, but of child type
     */
    WritableIntChunk[] writableData;

    WritableIntChunkChunk(WritableIntChunk[] data, int offset, int capacity) {
        super(data, offset, capacity);
        this.writableData = data;
    }

    public final void set(int index, WritableIntChunk value) {
        data[offset + index] = value;
        resetInnerCacheItem(index, value);
    }

    @Override
    public final WritableIntChunk getWritableChunk(int pos) {
        return writableData[offset + pos];
    }

    @Override
    public final void setWritableChunk(int pos, WritableChunk value) {
        set(pos, value.asWritableIntChunk());
    }

    public final void set(int j, int i, int value) {
        innerData[j][innerOffsets[j] + i] = value;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy