Class ShortIndexer

java.lang.Object
org.bytedeco.javacpp.indexer.Indexer
org.bytedeco.javacpp.indexer.ShortIndexer
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
ShortArrayIndexer, ShortBufferIndexer, ShortRawIndexer

public abstract class ShortIndexer extends Indexer
Abstract indexer for the short primitive type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The number of bytes used to represent a short.

    Fields inherited from class org.bytedeco.javacpp.indexer.Indexer

    index, indexable, sizes, strides
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ShortIndexer(long[] sizes, long[] strides)
     
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(short[] array)
    Returns new ShortArrayIndexer(array)
    create(short[] array, long... sizes)
    Returns new ShortArrayIndexer(array, sizes)
    create(short[] array, long[] sizes, long[] strides)
    Returns new ShortArrayIndexer(array, sizes, strides)
    create(short[] array, Index index)
    Returns new ShortArrayIndexer(array, index)
    Returns new ShortBufferIndexer(buffer)
    create(ShortBuffer buffer, long... sizes)
    Returns new ShortBufferIndexer(buffer, sizes)
    create(ShortBuffer buffer, long[] sizes, long[] strides)
    Returns new ShortBufferIndexer(buffer, sizes, strides)
    create(ShortBuffer buffer, Index index)
    Returns new ShortBufferIndexer(buffer, index)
    Returns new ShortRawIndexer(pointer)
    create(ShortPointer pointer, long... sizes)
    Returns new ShortRawIndexer(pointer, sizes)
    create(ShortPointer pointer, long[] sizes, long[] strides)
    Returns new ShortRawIndexer(pointer, sizes, strides)
    create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)
    Returns create(pointer, Index.create(sizes, strides), direct)
    create(ShortPointer pointer, Index index)
    Returns new ShortRawIndexer(pointer, index)
    create(ShortPointer pointer, Index index, boolean direct)
    Creates a short indexer to access efficiently the data of a pointer.
    abstract short
    get(long i)
    Returns array/buffer[index(i)]
    abstract short
    get(long... indices)
    Returns array/buffer[index(indices)]
    get(long[] indices, short[] s)
    Returns this where s = array/buffer[index(indices)]
    abstract ShortIndexer
    get(long[] indices, short[] s, int offset, int length)
    Returns this where s[offset:offset + length] = array/buffer[index(indices)]
    abstract short
    get(long i, long j)
    Returns array/buffer[index(i, j)]
    abstract short
    get(long i, long j, long k)
    Returns array/buffer[index(i, j, k)]
    get(long i, long j, short[] s)
    Returns this where s = array/buffer[index(i, j)]
    abstract ShortIndexer
    get(long i, long j, short[] s, int offset, int length)
    Returns this where s[offset:offset + length] = array/buffer[index(i, j)]
    get(long i, short[] s)
    Returns this where s = array/buffer[index(i)]
    abstract ShortIndexer
    get(long i, short[] s, int offset, int length)
    Returns this where s[offset:offset + length] = array/buffer[index(i)]
    double
    getDouble(long... indices)
    Calls get(int...indices) and returns the value as a double.
    abstract ShortIndexer
    put(long[] indices, short s)
    Returns this where array/buffer[index(indices)] = s
    put(long[] indices, short... s)
    Returns this where array/buffer[index(indices)] = s
    abstract ShortIndexer
    put(long[] indices, short[] s, int offset, int length)
    Returns this where array/buffer[index(indices)] = s[offset:offset + length]
    abstract ShortIndexer
    put(long i, long j, long k, short s)
    Returns this where array/buffer[index(i, j, k)] = s
    abstract ShortIndexer
    put(long i, long j, short s)
    Returns this where array/buffer[index(i, j)] = s
    put(long i, long j, short... s)
    Returns this where array/buffer[index(i, j)] = s
    abstract ShortIndexer
    put(long i, long j, short[] s, int offset, int length)
    Returns this where array/buffer[index(i, j)] = s[offset:offset + length]
    abstract ShortIndexer
    put(long i, short s)
    Returns this where array/buffer[index(i)] = s
    put(long i, short... s)
    Returns this where array/buffer[index(i)] = s
    abstract ShortIndexer
    put(long i, short[] s, int offset, int length)
    Returns this where array/buffer[index(i)] = s[offset:offset + length]
    putDouble(long[] indices, double s)
    Casts value to primitive type and calls put(long[] indices, <type> value).

    Methods inherited from class org.bytedeco.javacpp.indexer.Indexer

    array, buffer, channels, checkIndex, close, cols, height, index, index, index, index, indexable, indexable, pointer, rank, reindex, release, rows, size, sizes, stride, strides, strides, toString, width

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • VALUE_BYTES

      public static final int VALUE_BYTES
      The number of bytes used to represent a short.
      See Also:
  • Constructor Details

    • ShortIndexer

      protected ShortIndexer(Index index)
    • ShortIndexer

      protected ShortIndexer(long[] sizes, long[] strides)
  • Method Details

    • create

      public static ShortIndexer create(short[] array)
      Returns new ShortArrayIndexer(array)
    • create

      public static ShortIndexer create(ShortBuffer buffer)
      Returns new ShortBufferIndexer(buffer)
    • create

      public static ShortIndexer create(ShortPointer pointer)
      Returns new ShortRawIndexer(pointer)
    • create

      public static ShortIndexer create(short[] array, Index index)
      Returns new ShortArrayIndexer(array, index)
    • create

      public static ShortIndexer create(ShortBuffer buffer, Index index)
      Returns new ShortBufferIndexer(buffer, index)
    • create

      public static ShortIndexer create(ShortPointer pointer, Index index)
      Returns new ShortRawIndexer(pointer, index)
    • create

      public static ShortIndexer create(short[] array, long... sizes)
      Returns new ShortArrayIndexer(array, sizes)
    • create

      public static ShortIndexer create(ShortBuffer buffer, long... sizes)
      Returns new ShortBufferIndexer(buffer, sizes)
    • create

      public static ShortIndexer create(ShortPointer pointer, long... sizes)
      Returns new ShortRawIndexer(pointer, sizes)
    • create

      public static ShortIndexer create(short[] array, long[] sizes, long[] strides)
      Returns new ShortArrayIndexer(array, sizes, strides)
    • create

      public static ShortIndexer create(ShortBuffer buffer, long[] sizes, long[] strides)
      Returns new ShortBufferIndexer(buffer, sizes, strides)
    • create

      public static ShortIndexer create(ShortPointer pointer, long[] sizes, long[] strides)
      Returns new ShortRawIndexer(pointer, sizes, strides)
    • create

      public static ShortIndexer create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)
      Returns create(pointer, Index.create(sizes, strides), direct)
    • create

      public static ShortIndexer create(ShortPointer pointer, Index index, boolean direct)
      Creates a short indexer to access efficiently the data of a pointer.
      Parameters:
      pointer - data to access via a buffer or to copy to an array
      index - to use
      direct - true to use a direct buffer, see Indexer for details
      Returns:
      the new short indexer backed by the raw memory interface, a buffer, or an array
    • get

      public abstract short get(long i)
      Returns array/buffer[index(i)]
    • get

      public ShortIndexer get(long i, short[] s)
      Returns this where s = array/buffer[index(i)]
    • get

      public abstract ShortIndexer get(long i, short[] s, int offset, int length)
      Returns this where s[offset:offset + length] = array/buffer[index(i)]
    • get

      public abstract short get(long i, long j)
      Returns array/buffer[index(i, j)]
    • get

      public ShortIndexer get(long i, long j, short[] s)
      Returns this where s = array/buffer[index(i, j)]
    • get

      public abstract ShortIndexer get(long i, long j, short[] s, int offset, int length)
      Returns this where s[offset:offset + length] = array/buffer[index(i, j)]
    • get

      public abstract short get(long i, long j, long k)
      Returns array/buffer[index(i, j, k)]
    • get

      public abstract short get(long... indices)
      Returns array/buffer[index(indices)]
    • get

      public ShortIndexer get(long[] indices, short[] s)
      Returns this where s = array/buffer[index(indices)]
    • get

      public abstract ShortIndexer get(long[] indices, short[] s, int offset, int length)
      Returns this where s[offset:offset + length] = array/buffer[index(indices)]
    • put

      public abstract ShortIndexer put(long i, short s)
      Returns this where array/buffer[index(i)] = s
    • put

      public ShortIndexer put(long i, short... s)
      Returns this where array/buffer[index(i)] = s
    • put

      public abstract ShortIndexer put(long i, short[] s, int offset, int length)
      Returns this where array/buffer[index(i)] = s[offset:offset + length]
    • put

      public abstract ShortIndexer put(long i, long j, short s)
      Returns this where array/buffer[index(i, j)] = s
    • put

      public ShortIndexer put(long i, long j, short... s)
      Returns this where array/buffer[index(i, j)] = s
    • put

      public abstract ShortIndexer put(long i, long j, short[] s, int offset, int length)
      Returns this where array/buffer[index(i, j)] = s[offset:offset + length]
    • put

      public abstract ShortIndexer put(long i, long j, long k, short s)
      Returns this where array/buffer[index(i, j, k)] = s
    • put

      public abstract ShortIndexer put(long[] indices, short s)
      Returns this where array/buffer[index(indices)] = s
    • put

      public ShortIndexer put(long[] indices, short... s)
      Returns this where array/buffer[index(indices)] = s
    • put

      public abstract ShortIndexer put(long[] indices, short[] s, int offset, int length)
      Returns this where array/buffer[index(indices)] = s[offset:offset + length]
    • getDouble

      public double getDouble(long... indices)
      Description copied from class: Indexer
      Calls get(int...indices) and returns the value as a double.
      Specified by:
      getDouble in class Indexer
    • putDouble

      public ShortIndexer putDouble(long[] indices, double s)
      Description copied from class: Indexer
      Casts value to primitive type and calls put(long[] indices, <type> value).
      Specified by:
      putDouble in class Indexer