public interface IntArray
Interface IntArray
represents an immutable int[]
array.
IntArray
are required to be immutable.Modifier and Type | Method and Description |
---|---|
default java.lang.String |
asString()
Returns a string representation of this
IntArray by applying
java.utils.Arrays.toString() to an equivalent int[]
object. |
static IntArray |
create(int[] ia,
int min,
int max)
Returns a new
IntArray instance that has the same
sequence of nonnegative integers as the specified array. |
int |
get(int index)
Returns the specified array element.
|
int |
size()
Returns the number of elements.
|
java.lang.String |
toString()
Returns a string representation of this
IntArray by applying
java.utils.Arrays.toString() to an equivalent int[]
object. |
int size()
int get(int index)
index
- an array indexjava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.size()
java.lang.String toString()
IntArray
by applying
java.utils.Arrays.toString()
to an equivalent int[]
object.toString
in class java.lang.Object
IntArray
default java.lang.String asString()
IntArray
by applying
java.utils.Arrays.toString()
to an equivalent int[]
object.IntArray
.static IntArray create(int[] ia, int min, int max)
IntArray
instance that has the same
sequence of nonnegative integers as the specified array.ia
- the array of non-negative integers to be copiedmin
- the minimum element in the specified arraymax
- the maximum element in the specified arrayIntArray
instance that has
the same sequence of integers as the specified arrayjava.lang.IllegalArgumentException
- if minElement > maxElement
java.lang.IllegalArgumentException
- if an out-of-range
element is detectedjava.lang.NullPointerException
- if ia == null