public class UaArrayDimensions extends Object
Attributes.ArrayDimensions, where the values represents the maximums number of elements
per dimension, or 0 if unknown/unlimited. Can also be used to model the actual, exact, dimensions
of a (possibly multidimensional) value. Instances can be constructed via static factory methods.
This class is considered to be sealed, i.e. static factory methods may return subclasses of this
class, but no new subclasses can be defined outside of the SDK.| Modifier and Type | Field and Description |
|---|---|
static UaArrayDimensions |
EMPTY |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
UnsignedInteger |
get(int index)
Returns the element at index.
|
List<UnsignedInteger> |
getValue()
Deprecated.
use
toList() instead. |
int |
hashCode() |
boolean |
isEmpty()
Returns true if
size() is 0, false otherwise. |
static boolean |
isNullOrEmpty(UaArrayDimensions arrayDimensions)
Returns true if given
UaArrayDimensions is null or isEmpty()
is true, false otherwise. |
boolean |
isUnlimited()
Returns true, if any dimension
isUnlimited(int), i.e. |
boolean |
isUnlimited(int index)
Returns true, if the dimension with the index is not limited in size, i.e.
|
static UaArrayDimensions |
ones(int dimensions)
Returns an
UaArrayDimensions that has the given dimensions and value 1 for each
element. |
static UaArrayDimensions |
parse(String string)
|
int |
size()
Returns the number of dimensions.
|
UnsignedInteger[] |
toArray()
Returns (a new) array of the data.
|
int[] |
toIntArray()
Returns (a new) array of the data as int[].
|
List<UnsignedInteger> |
toList()
Returns an unmodifiable list representing the ArrayDimensions.
|
long[] |
toLongArray()
Returns (a new) array of the data as long[].
|
String |
toString() |
static UaArrayDimensions |
unlimited(int dimensions)
Returns an
UaArrayDimensions that has the given dimensions and value 0 for each
element. |
static UaArrayDimensions |
valueOf()
Returns
EMPTY. |
static UaArrayDimensions |
valueOf(int[] values)
Returns
UaArrayDimensions containing the given values. |
static UaArrayDimensions |
valueOf(List<UnsignedInteger> values)
Returns
UaArrayDimensions containing the given values. |
static UaArrayDimensions |
valueOf(long... value)
Returns
UaArrayDimensions containing the given values. |
static UaArrayDimensions |
valueOf(UnsignedInteger... value)
Returns
UaArrayDimensions containing the given values. |
static UaArrayDimensions |
zeros(int dimensions)
Returns an
UaArrayDimensions that has the given dimensions and value 0 for each
element. |
public static final UaArrayDimensions EMPTY
public static boolean isNullOrEmpty(UaArrayDimensions arrayDimensions)
UaArrayDimensions is null or isEmpty()
is true, false otherwise.public static UaArrayDimensions ones(int dimensions)
UaArrayDimensions that has the given dimensions and value 1 for each
element. Throws IllegalArgumentException if given dimensions < 0.public static UaArrayDimensions parse(String string)
UaArrayDimensions from given String of comma separated
UnsignedInteger values. The String can optionally begin and end with a square bracket
(as output by toString()). Returns EMPTY for null and empty Strings. Throws
IllegalArgumentException on invalid input.public static UaArrayDimensions unlimited(int dimensions)
UaArrayDimensions that has the given dimensions and value 0 for each
element. Throws IllegalArgumentException if given dimensions < 0.public static UaArrayDimensions valueOf()
EMPTY.public static UaArrayDimensions valueOf(int[] values)
UaArrayDimensions containing the given values. Each given int is converted to
UnsignedInteger.valueOf(long), with this method throwing
IllegalArgumentException if UnsignedInteger.valueOf(long), would throw. Returns
null if given null array.public static UaArrayDimensions valueOf(List<UnsignedInteger> values)
UaArrayDimensions containing the given values. Returns null if given null. Any
null element in the list itself is treated as UnsignedInteger.ZERO.public static UaArrayDimensions valueOf(long... value)
UaArrayDimensions containing the given values. Each given long is converted to
UnsignedInteger.valueOf(long), with this method throwing
IllegalArgumentException if UnsignedInteger.valueOf(long), would throw. Returns
null if given null array.public static UaArrayDimensions valueOf(UnsignedInteger... value)
UaArrayDimensions containing the given values. Returns null if given null
array. Any null element in the array itself is treated as UnsignedInteger.ZERO.public static UaArrayDimensions zeros(int dimensions)
UaArrayDimensions that has the given dimensions and value 0 for each
element. Throws IllegalArgumentException if given dimensions < 0.public UnsignedInteger get(int index)
index - the index of the dimensionIndexOutOfBoundsException - if the index is beyond the dimensions@Deprecated public List<UnsignedInteger> getValue()
toList() instead.public boolean isEmpty()
size() is 0, false otherwise.public boolean isUnlimited()
isUnlimited(int), i.e. equals to 0.isUnlimited(int)public boolean isUnlimited(int index)
isUnlimited()public int size()
toList().public UnsignedInteger[] toArray()
List.toArray() on the
getValue().public int[] toIntArray()
List.toArray() on
the getValue() and transforming the values to int. Note that the value for any element
shouldn't be over int32 max value, but if they are, int32 max value is used instead in the
returned array.public List<UnsignedInteger> toList()
public long[] toLongArray()
List.toArray() on
the getValue() and transforming the values to long.Copyright © 2026. All rights reserved.