Package de.gsi.dataset.utils.serializer
Interface MultiArray<T>
-
- Type Parameters:
T- generics for primitive array (ie. double[], float[], int[] ...)
public interface MultiArray<T>Interface for multi-dimensional arrays of any type. The representation of multi-dimensional array is in fact one-dimensional array, because of 2 reasons: - we always want to support only rectangle arrays (not arbitrary row length) - it corresponds to C++ implementation, where 1D array is used as well (to support static multi-dimensional arrays)- Author:
- Ilia Yastrebov, CERN, Joel Lauener, CERN, rstein
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectget(int index)Returns the element at a given indices.java.lang.Objectget(int[] indices)Returns the element at given indices.booleangetBoolean(int[] indices)Returns the element at given indices.bytegetByte(int[] indices)Returns the element at given indices.int[]getDimensions()Returns the dimensions of the array.doublegetDouble(int[] indices)Returns the element at given indices.TgetElements()Returns the array of all elements of multi-dimensional array.intgetElementsCount()Returns the number of elements in the multi-dimensional array.floatgetFloat(int[] indices)Returns the element at given indices.intgetIndex(int[] indices)Returns the element at given indices.intgetInt(int[] indices)Returns the element at given indices.longgetLong(int[] indices)Returns the element at given indices.shortgetShort(int[] indices)Returns the element at given indices.java.lang.StringgetString(int[] indices)Returns the element at given indices.
-
-
-
Method Detail
-
getElements
T getElements()
Returns the array of all elements of multi-dimensional array.- Returns:
- the array of all elements
-
getElementsCount
int getElementsCount()
Returns the number of elements in the multi-dimensional array.- Returns:
- the number of elements
-
getIndex
int getIndex(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- index for the one-dimensional array
-
get
java.lang.Object get(int index)
Returns the element at a given indices.- Parameters:
index- the indices- Returns:
- the element
-
get
java.lang.Object get(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the element
-
getBoolean
boolean getBoolean(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the primitive element
-
getByte
byte getByte(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the primitive element
-
getShort
short getShort(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the primitive element
-
getInt
int getInt(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the primitive element
-
getLong
long getLong(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the primitive element
-
getFloat
float getFloat(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the primitive element
-
getDouble
double getDouble(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the primitive element
-
getString
java.lang.String getString(int[] indices)
Returns the element at given indices.- Parameters:
indices- position of the element in the multi-dimensional array- Returns:
- the element
-
getDimensions
int[] getDimensions()
Returns the dimensions of the array.- Returns:
- the dimensions
-
-