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

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

The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.chunk;

import io.deephaven.chunk.attributes.Any;

/**
 * {@link ChunkChunk} that may have its backing storage reset to a slice of that belonging to another {@link ChunkChunk}
 * or a native array.
 */
public interface ResettableChunkChunk extends ChunkChunk {

    /**
     * Reset the data and bounds of this chunk to a range or sub-range of the specified {@link ChunkChunk}.
     *
     * @param other The other {@link ChunkChunk}
     * @param offset The offset into other
     * @param capacity The capacity this should have after reset
     */
    void resetFromChunk(ChunkChunk other, int offset, int capacity);

    /**
     * Reset the data and bounds of this chunk to a range or sub-range of the specified array.
     *
     * @param array The array
     * @param offset The offset into array
     * @param capacity The capacity this should have after reset
     */
    void resetFromArray(Object array, int offset, int capacity);

    default ResettableByteChunkChunk asResettableByteChunkChunk() {
        return (ResettableByteChunkChunk) this;
    }

    default ResettableBooleanChunkChunk asResettableBooleanChunkChunk() {
        return (ResettableBooleanChunkChunk) this;
    }

    default ResettableCharChunkChunk asResettableCharChunkChunk() {
        return (ResettableCharChunkChunk) this;
    }

    default ResettableShortChunkChunk asResettableShortChunkChunk() {
        return (ResettableShortChunkChunk) this;
    }

    default ResettableIntChunkChunk asResettableIntChunkChunk() {
        return (ResettableIntChunkChunk) this;
    }

    default ResettableLongChunkChunk asResettableLongChunkChunk() {
        return (ResettableLongChunkChunk) this;
    }

    default ResettableFloatChunkChunk asResettableFloatChunkChunk() {
        return (ResettableFloatChunkChunk) this;
    }

    default ResettableDoubleChunkChunk asResettableDoubleChunkChunk() {
        return (ResettableDoubleChunkChunk) this;
    }

    default  ResettableObjectChunkChunk asResettableObjectChunkChunk() {
        return (ResettableObjectChunkChunk) this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy