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

io.deephaven.chunk.WritableLongChunkChunk 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 WritableLongChunkChunk extends LongChunkChunk implements WritableChunkChunk {

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

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

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

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

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy