Constructor | Description |
---|---|
PackedIntArray(int[] ia,
int valueSize) |
Constructs a new
PackedIntArray instance from the specified data. |
PackedIntArray(IntList il,
int valueSize) |
Constructs a new
PackedIntArray instance from the specified data. |
Modifier and Type | Method | Description |
---|---|---|
static PackedIntArray |
fromSignedByteArray(byte[] ba,
int valueSize) |
Constructs and returns a new
PackedIntArray instance from the
specified data. |
static PackedIntArray |
fromSignedByteArray(byte[] ba,
int from,
int to,
int valueSize) |
Constructs a new
PackedIntArray instance from the
specified data. |
static PackedIntArray |
fromUnsignedByteArray(byte[] ba,
int valueSize) |
Constructs a new
PackedIntArray instance from the
specified data. |
static PackedIntArray |
fromUnsignedByteArray(byte[] ba,
int from,
int to,
int valueSize) |
Constructs a new
PackedIntArray instance from the
specified data. |
static PackedIntArray |
fromUnsignedTwoByteArray(byte[] ba,
int valueSize) |
Constructs a new
PackedIntArray instance from the
specified data. |
int |
get(int index) |
Returns the specified array element.
|
int |
size() |
Returns the number of elements in this
IntArray . |
public PackedIntArray(int[] ia, int valueSize)
PackedIntArray
instance from the specified data.ia
- an array of nonnegative integer valuesvalueSize
- the exclusive end of the range of non-negative
array valuesjava.lang.IllegalArgumentException
- if valueSize < 1
java.lang.IllegalArgumentException
- if
(ia[j] < 0 || ia[j] > valueSize)
for any index j
satisfying (j >= 0 && j < ia.length)
java.lang.NullPointerException
- if ia == null
public PackedIntArray(IntList il, int valueSize)
PackedIntArray
instance from the specified data.il
- an array of nonnegative integer valuesvalueSize
- the exclusive end of the range of non-negative
array valuesjava.lang.IllegalArgumentException
- if valueSize < 1
java.lang.IllegalArgumentException
- if
(il.get(j) < 0 || il.get(j) > valueSize)
for any index j
satisfying (j >= 0 && j < il.size())
java.lang.NullPointerException
- if il == null
public static PackedIntArray fromSignedByteArray(byte[] ba, int valueSize)
PackedIntArray
instance from the
specified data.ba
- an array of non-negative integer valuesvalueSize
- the exclusive end of the range of non-negative
array valuesPackedIntArray
instancejava.lang.IllegalArgumentException
- if valueSize < 1
java.lang.IllegalArgumentException
- if
(ia[j] < 0 || ia[j] > valueSize)
for any index j
satisfying (j >= 0 && j < ia.length)
java.lang.NullPointerException
- if ia == null
public static PackedIntArray fromSignedByteArray(byte[] ba, int from, int to, int valueSize)
PackedIntArray
instance from the
specified data.ba
- an array of non-negative integer valuesfrom
- the first element to be included (inclusive)to
- the last element to be included (exclusive)valueSize
- the exclusive end of the range of non-negative
array valuesPackedIntArray
instancejava.lang.IllegalArgumentException
- if valueSize < 1
java.lang.IllegalArgumentException
- if
(ia[j] < 0 || ia[j] > valueSize)
for any index j
satisfying (j >= 0 && j < ia.length)
java.lang.IndexOutOfBoundsException
- if from < 0 || to > ia.length
java.lang.NegativeArraySizeException
- if to > from
java.lang.NullPointerException
- if ia == null
public static PackedIntArray fromUnsignedByteArray(byte[] ba, int valueSize)
PackedIntArray
instance from the
specified data.ba
- an array of non-negative integer values represented
as unsigned bytesvalueSize
- the exclusive end of the range of non-negative
array valuesPackedIntArray
instancejava.lang.IllegalArgumentException
- if valueSize < 1
java.lang.IllegalArgumentException
- if
(ia[j] < 0 || ia[j] > valueSize)
for any index j
satisfying (j >= 0 && j < ia.length)
java.lang.NullPointerException
- if ia == null
public static PackedIntArray fromUnsignedByteArray(byte[] ba, int from, int to, int valueSize)
PackedIntArray
instance from the
specified data.ba
- an array of non-negative integer values represented
as unsigned bytesfrom
- the first element to be included (inclusive)to
- the last element to be included (exclusive)valueSize
- the exclusive end of the range of non-negative
array valuesPackedIntArray
instancejava.lang.IllegalArgumentException
- if valueSize < 1
java.lang.IllegalArgumentException
- if
(ia[j] < 0 || ia[j] > valueSize)
for any index j
satisfying (j >= 0 && j < ia.length)
java.lang.IndexOutOfBoundsException
- if from < 0 || to > ia.length
java.lang.NegativeArraySizeException
- if to > from
java.lang.NullPointerException
- if ia == null
public static PackedIntArray fromUnsignedTwoByteArray(byte[] ba, int valueSize)
PackedIntArray
instance from the
specified data. The specified array represents ba.length/2
unsigned two-byte values. The j
-th unsigned two-byte value is
stored in array elements 2*j
and (2*j + 1)
, with the
higher-order byte stored in element 2*j
.ba
- an array of non-negative integer values represented
as unsigned two-byte integers.valueSize
- the exclusive end of the range of non-negative
array valuesPackedIntArray
instancejava.lang.IllegalArgumentException
- if valueSize < 1
java.lang.IllegalArgumentException
- if
(ia[j] < 0 || ia[j] > valueSize)
for any index j
satisfying (j >= 0 && j < ia.length)
java.lang.IllegalArgumentException
- if (ba.length & 1) != 0
java.lang.NullPointerException
- if ia == null
public int size()
IntArray
IntArray
.