public class HDF5EnumerationValueArray
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>
Constructor and Description |
---|
HDF5EnumerationValueArray(HDF5EnumerationType type,
byte[] ordinalArray)
Creates an enumeration value array.
|
HDF5EnumerationValueArray(HDF5EnumerationType type,
java.lang.Enum<?>[] valueArray)
Creates an enumeration value array.
|
HDF5EnumerationValueArray(HDF5EnumerationType type,
int[] ordinalArray)
Creates an enumeration value array.
|
HDF5EnumerationValueArray(HDF5EnumerationType type,
short[] ordinalArray)
Creates an enumeration value array.
|
HDF5EnumerationValueArray(HDF5EnumerationType type,
java.lang.String[] valueArray)
Creates an enumeration value array.
|
Modifier and Type | Method and Description |
---|---|
int |
getLength()
Returns the number of members of this enumeration array.
|
int |
getOrdinal(int arrayIndex)
Returns the ordinal value for the arrayIndex.
|
HDF5EnumerationType |
getType()
Returns the type of this enumeration array.
|
<T extends java.lang.Enum<T>> |
getValue(java.lang.Class<T> enumClass,
int arrayIndex)
Returns the value as Enum of type enumClass.
|
java.lang.String |
getValue(int arrayIndex)
Returns the string value for arrayIndex.
|
java.util.Iterator<java.lang.String> |
iterator() |
<T extends java.lang.Enum<T>> |
toEnumArray(java.lang.Class<T> enumClass)
Returns the values for all elements of this array as Enums of type enumClass.
|
java.lang.String |
toString() |
java.lang.String[] |
toStringArray()
Returns the string values for all elements of this array.
|
public HDF5EnumerationValueArray(HDF5EnumerationType type, byte[] 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 HDF5EnumerationValueArray(HDF5EnumerationType type, short[] 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 HDF5EnumerationValueArray(HDF5EnumerationType type, int[] 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 HDF5EnumerationValueArray(HDF5EnumerationType type, java.lang.Enum<?>[] valueArray) throws java.lang.IllegalArgumentException
type
- The enumeration type of this value.valueArray
- The array of enum values (each one needs to be one of the values of
type).java.lang.IllegalArgumentException
- If any of the values in the valueArray is not one
of the values of type.public HDF5EnumerationValueArray(HDF5EnumerationType type, java.lang.String[] valueArray) throws java.lang.IllegalArgumentException
type
- The enumeration type of this value.valueArray
- The array of string values (each one needs to be one of the values of
type).java.lang.IllegalArgumentException
- If any of the values in the valueArray is not one
of the values of type.public HDF5EnumerationType getType()
public int getLength()
public int getOrdinal(int arrayIndex)
arrayIndex
- The index 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 <T extends java.lang.Enum<T>> T getValue(java.lang.Class<T> enumClass, int arrayIndex)
enumClass
- The class to return the value as.arrayIndex
- The index in the array to get the value for.public java.lang.String[] toStringArray()
public <T extends java.lang.Enum<T>> T[] toEnumArray(java.lang.Class<T> enumClass)
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public java.lang.String toString()
toString
in class java.lang.Object