Interface Array

All Known Subinterfaces:
VBooleanArray, VByteArray, VDoubleArray, VEnumArray, VFloatArray, VIntArray, VLongArray, VNumberArray, VShortArray, VStringArray
All Known Implementing Classes:
AggregateArrayVType, ArrayArrayVType, BooleanArrayVType, DoubleArrayVType, EnumeratedArrayVType, FloatArrayVType, IVBooleanArray, IVByteArray, IVDoubleArray, IVEnumArray, IVFloatArray, IVIntArray, IVLongArray, IVNumberArray, IVShortArray, IVStringArray, Sint32ArrayVType, Sint64ArrayVType, StringArrayVType, Uint32ArrayVType, Uint64ArrayVType

public interface Array
Multi dimensional array, which can be used for waveforms or more rich data.

The data is stored in a linear structure. The sizes array gives the dimensionality and size for each dimension. The ordering defined by the sizes is [..., zSize, ySize, xSize]. Typical iteration is:

 for (...) {
   for (var z = 0; z < zSize; z++) {
     for (var y = 0; y < ySize; y++) {
       for (var x = 0; x < xSize; x++) {
          array.getData().getDouble(... + z*ySize + y*xSize + x);
       }
     }
   }
 }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the object containing the array data.
    The shape of the multidimensional array.
  • Method Details

    • getData

      Object getData()
      Return the object containing the array data.

      This method will either return a List or a ListNumber depending of the array type. A collection is returned, instead of an array, so that the type implementation can be immutable or can at least try to prevent modifications. ListNumber has also several advantages over the Java arrays, including the ability to iterate the list regardless of numeric type.

      If a numeric array is actually needed, refer to CollectionNumbers.

      Returns:
      the array data
    • getSizes

      ListInt getSizes()
      The shape of the multidimensional array.

      The size of the returned list will be the number of the dimension of the array. Each number represents the size of each dimension. The total number of elements in the array is therefore the product of all the numbers in the list returned.

      Returns:
      the dimension sizes