Package ints
Class WrappedIntArray
- java.lang.Object
-
- ints.WrappedIntArray
-
-
Constructor Summary
Constructors Constructor Description WrappedIntArray(int[] ia)
Constructs a newWrappedIntArray
instance.WrappedIntArray(int[] ia, int valueSize)
Constructs a newWrappedIntArray
instance.WrappedIntArray(IntList il)
Constructs a newWrappedIntArray
instance.WrappedIntArray(IntList il, int valueSize)
Constructs a newWrappedIntArray
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
get(int index)
Returns the specified array element.int
size()
Returns the number of elements in thisIntArray
.java.lang.String
toString()
-
-
-
Constructor Detail
-
WrappedIntArray
public WrappedIntArray(int[] ia)
Constructs a newWrappedIntArray
instance.- Parameters:
ia
- an array of integers- Throws:
java.lang.NullPointerException
- ifia == null
-
WrappedIntArray
public WrappedIntArray(int[] ia, int valueSize)
Constructs a newWrappedIntArray
instance.- Parameters:
ia
- an array of integersvalueSize
- the exclusive end of the range of non-negative array values- Throws:
java.lang.IllegalArgumentException
- if(ia[j] < 0 || ia[j] > valueSize)
for any indexj
satisfying(j >= 0 && j < ia.length)
java.lang.NullPointerException
- ifia == null
-
WrappedIntArray
public WrappedIntArray(IntList il)
Constructs a newWrappedIntArray
instance.- Parameters:
il
- a list of integers- Throws:
java.lang.NullPointerException
- ifil == null
-
WrappedIntArray
public WrappedIntArray(IntList il, int valueSize)
Constructs a newWrappedIntArray
instance.- Parameters:
il
- a list of integersvalueSize
- the exclusive end of the range of non-negative array values- Throws:
java.lang.IllegalArgumentException
- if(il[j] < 0 || il[j] > valueSize)
for any indexj
satisfying(j >= 0 && j < il.length)
java.lang.NullPointerException
- ifil == null
-
-
Method Detail
-
size
public int size()
Description copied from interface:IntArray
Returns the number of elements in thisIntArray
.
-
get
public int get(int index)
Description copied from interface:IntArray
Returns the specified array element.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-