public class HDF5EnumerationValueMDArray
extends java.lang.Object
implements java.lang.Iterable<ch.systemsx.cisd.base.mdarray.MDAbstractArray.ArrayEntry>
Constructor and Description |
---|
HDF5EnumerationValueMDArray(HDF5EnumerationType type,
ch.systemsx.cisd.base.mdarray.MDAbstractArray<?> ordinalArray)
Creates an enumeration value array.
|
HDF5EnumerationValueMDArray(HDF5EnumerationType type,
ch.systemsx.cisd.base.mdarray.MDByteArray ordinalArray)
Creates an enumeration value array.
|
HDF5EnumerationValueMDArray(HDF5EnumerationType type,
ch.systemsx.cisd.base.mdarray.MDIntArray ordinalArray)
Creates an enumeration value array.
|
HDF5EnumerationValueMDArray(HDF5EnumerationType type,
ch.systemsx.cisd.base.mdarray.MDShortArray ordinalArray)
Creates an enumeration value array.
|
HDF5EnumerationValueMDArray(int rank)
Creates an empty array with given rank.
|
Modifier and Type | Method and Description |
---|---|
int[] |
dimensions()
Returns the dimensions of this enumeration array.
|
boolean |
equals(java.lang.Object obj) |
int |
getOrdinal(int... arrayIndices)
Returns the ordinal value for the arrayIndex.
|
int |
getOrdinal(int arrayIndex)
Returns the ordinal value for the arrayIndex.
|
int |
getOrdinal(int arrayIndexX,
int arrayIndexY)
Returns the ordinal value for the arrayIndex.
|
ch.systemsx.cisd.base.mdarray.MDAbstractArray<?> |
getOrdinalValues()
Returns the ordinal values for all elements of this array.
|
HDF5EnumerationType |
getType()
Returns the type of this enumeration array.
|
<T extends java.lang.Enum<T>> |
getValue(java.lang.Class<T> enumClass,
int... arrayIndices)
Returns the value as Enum of type enumClass.
|
java.lang.String |
getValue(int... arrayIndices)
Returns the string value for arrayIndex.
|
java.lang.String |
getValue(int arrayIndex)
Returns the string value for arrayIndex.
|
java.lang.String |
getValue(int arrayIndexX,
int arrayIndexY)
Returns the string value for arrayIndex.
|
int |
hashCode() |
java.util.Iterator<ch.systemsx.cisd.base.mdarray.MDAbstractArray.ArrayEntry> |
iterator() |
long[] |
longDimensions()
Returns the dimensions of this enumeration array as a long.
|
int |
rank()
Returns the rank of this multi-dimensional enumeration array.
|
int |
size()
Returns the number of elements of this enumeration array.
|
int |
size(int dim)
Returns the extent of this enum array along its dim-th axis.
|
<T extends java.lang.Enum<T>> |
toEnumArray(java.lang.Class<T> enumClass)
Returns the values for all elements of this array as an enum array with enums of type
enumClass.
|
java.lang.String |
toString() |
ch.systemsx.cisd.base.mdarray.MDArray<java.lang.String> |
toStringArray()
Returns the string values for all elements of this array.
|
public HDF5EnumerationValueMDArray(HDF5EnumerationType type, ch.systemsx.cisd.base.mdarray.MDAbstractArray<?> ordinalArray) throws java.lang.IllegalArgumentException
type
- The enumeration type of this value.ordinalArray
- The array of ordinal values in the type. Has to be one of
MDByteArray
, MDShortArray
or MDIntArray
.java.lang.IllegalArgumentException
- If any of the ordinals in the ordinalArray is
outside of the range of allowed values of the type.public HDF5EnumerationValueMDArray(int rank)
public HDF5EnumerationValueMDArray(HDF5EnumerationType type, ch.systemsx.cisd.base.mdarray.MDByteArray ordinalArray) throws java.lang.IllegalArgumentException
type
- The enumeration type of this value.ordinalArray
- The array of ordinal values in the type.java.lang.IllegalArgumentException
- If any of the ordinals in the ordinalArray is
outside of the range of allowed values of the type.public HDF5EnumerationValueMDArray(HDF5EnumerationType type, ch.systemsx.cisd.base.mdarray.MDShortArray ordinalArray) throws java.lang.IllegalArgumentException
type
- The enumeration type of this value.ordinalArray
- The array of ordinal values in the type.java.lang.IllegalArgumentException
- If any of the ordinals in the ordinalArray is
outside of the range of allowed values of the type.public HDF5EnumerationValueMDArray(HDF5EnumerationType type, ch.systemsx.cisd.base.mdarray.MDIntArray ordinalArray) throws java.lang.IllegalArgumentException
type
- The enumeration type of this value.ordinalArray
- The array of ordinal values in the type.java.lang.IllegalArgumentException
- If any of the ordinals in the ordinalArray is
outside of the range of allowed values of the type.public HDF5EnumerationType getType()
public int size()
public int size(int dim)
public int rank()
public int[] dimensions()
public long[] longDimensions()
public int getOrdinal(int arrayIndex)
arrayIndex
- The index in the array to get the ordinal for.public int getOrdinal(int arrayIndexX, int arrayIndexY)
arrayIndexX
- The x index in the array to get the ordinal for.arrayIndexY
- The y index in the array to get the ordinal for.public int getOrdinal(int... arrayIndices)
arrayIndices
- The indices in the array to get the ordinal for.public java.lang.String getValue(int arrayIndex)
arrayIndex
- The index in the array to get the value for.public java.lang.String getValue(int arrayIndexX, int arrayIndexY)
arrayIndexX
- The x index in the array to get the value for.arrayIndexY
- The y index in the array to get the value for.public java.lang.String getValue(int... arrayIndices)
arrayIndices
- The indices in the array to get the value for.public <T extends java.lang.Enum<T>> T getValue(java.lang.Class<T> enumClass, int... arrayIndices)
enumClass
- The class to return the value as.arrayIndices
- The indices in the array to get the value for.public ch.systemsx.cisd.base.mdarray.MDArray<java.lang.String> toStringArray()
public <T extends java.lang.Enum<T>> ch.systemsx.cisd.base.mdarray.MDArray<T> toEnumArray(java.lang.Class<T> enumClass)
public ch.systemsx.cisd.base.mdarray.MDAbstractArray<?> getOrdinalValues()
public java.util.Iterator<ch.systemsx.cisd.base.mdarray.MDAbstractArray.ArrayEntry> iterator()
iterator
in interface java.lang.Iterable<ch.systemsx.cisd.base.mdarray.MDAbstractArray.ArrayEntry>
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object