Package ucar.array
Class ArrayVlen<T>
- java.lang.Object
-
- ucar.array.Array<Array<T>>
-
- ucar.array.ArrayVlen<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ArrayVlen<T>
createFromStorage(ArrayType dataType, int[] shape, StorageMutable storage)
Creates a Vlen of type dataType, and the given shape and primitive array like double[][].static <T> StorageMutable<Array<T>>
createStorage(ArrayType dataType, int length, Object dataArray)
Creates storage for a Vlen of type dataType, and the given length and primitive array like double[][].static Object
createVlenArray(ArrayType dataType, int length)
Creates primitive array like double[length][] for a Vlen of type dataType, and the given length.static <T> ArrayVlen<T>
factory(ArrayType dataType, int[] shape)
Creates a Vlen of type dataType, and the given shape.static <T> ArrayVlen<T>
factory(ArrayType dataType, int[] shape, Object storage)
Creates a Vlen of type dataType, and the given shape and primitive array like double[][].Array<T>
get(int... index)
Get the element indicated by the list of multidimensional indices.Array<T>
get(Index index)
Get the element indicated by Index.boolean
isVlen()
Is variable length and will be represented by Vlen<T>Iterator<Array<T>>
iterator()
Iterates in canonical order over all the elements of the Array.void
set(int index, Object value)
Set the ith value.long
totalLength()
Element count of all the values in this Array.-
Methods inherited from class ucar.array.Array
contains, equals, getArrayType, getIndex, getRank, getScalar, getSection, getShape, getSize, hashCode, length, show, toString
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
factory
public static <T> ArrayVlen<T> factory(ArrayType dataType, int[] shape)
Creates a Vlen of type dataType, and the given shape. The shape of the resulting array has vlen dimension removed, if present.
-
factory
public static <T> ArrayVlen<T> factory(ArrayType dataType, int[] shape, Object storage)
Creates a Vlen of type dataType, and the given shape and primitive array like double[][]. The shape of the resulting array has vlen dimension removed, if present.
-
createFromStorage
public static <T> ArrayVlen<T> createFromStorage(ArrayType dataType, int[] shape, StorageMutable storage)
Creates a Vlen of type dataType, and the given shape and primitive array like double[][]. The shape of the resulting array has vlen dimension removed, if present.
-
createStorage
public static <T> StorageMutable<Array<T>> createStorage(ArrayType dataType, int length, Object dataArray)
Creates storage for a Vlen of type dataType, and the given length and primitive array like double[][].
-
createVlenArray
public static Object createVlenArray(ArrayType dataType, int length)
Creates primitive array like double[length][] for a Vlen of type dataType, and the given length.
-
isVlen
public boolean isVlen()
Description copied from class:Array
Is variable length and will be represented by Vlen<T>
-
totalLength
public long totalLength()
Element count of all the values in this Array.
-
iterator
public Iterator<Array<T>> iterator()
Description copied from class:Array
Iterates in canonical order over all the elements of the Array.
-
get
public Array<T> get(int... index)
Description copied from class:Array
Get the element indicated by the list of multidimensional indices.
-
get
public Array<T> get(Index index)
Description copied from class:Array
Get the element indicated by Index.
-
set
public void set(int index, Object value)
Set the ith value. Do not use after construction.- Parameters:
index
- 1d indexvalue
- a primitive array of T, eg double[] of any length, or an Array of T.
-
-