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

io.deephaven.chunk.ResettableReadOnlyChunk 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;
import io.deephaven.chunk.util.pools.PoolableChunk;

/**
 * {@link Chunk} that may have its backing storage reset to a slice of that belonging to another {@link Chunk} or a
 * native array.
 */
public interface ResettableReadOnlyChunk extends ResettableChunk, PoolableChunk {

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

    @Override
    default  Chunk resetFromChunk(WritableChunk other, int offset, int capacity) {
        return resetFromChunk((Chunk) other, offset, capacity);
    }

    @Override
     Chunk resetFromArray(Object array, int offset, int capacity);

    @Override
     Chunk resetFromArray(Object array);

    @Override
     Chunk clear();

    default ResettableByteChunk asResettableByteChunk() {
        return (ResettableByteChunk) this;
    }

    default ResettableBooleanChunk asResettableBooleanChunk() {
        return (ResettableBooleanChunk) this;
    }

    default ResettableCharChunk asResettableCharChunk() {
        return (ResettableCharChunk) this;
    }

    default ResettableShortChunk asResettableShortChunk() {
        return (ResettableShortChunk) this;
    }

    default ResettableIntChunk asResettableIntChunk() {
        return (ResettableIntChunk) this;
    }

    default ResettableLongChunk asResettableLongChunk() {
        return (ResettableLongChunk) this;
    }

    default ResettableFloatChunk asResettableFloatChunk() {
        return (ResettableFloatChunk) this;
    }

    default ResettableDoubleChunk asResettableDoubleChunk() {
        return (ResettableDoubleChunk) this;
    }

    default  ResettableObjectChunk asResettableObjectChunk() {
        return (ResettableObjectChunk) this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy