Package ints
Class CharArray
- java.lang.Object
-
- ints.CharArray
-
-
Constructor Summary
Constructors Constructor Description CharArray(byte[] ba)
Constructs a newCharArray
instance from the specified data.CharArray(char[] ca)
Constructs a newCharArray
instance from the specified data.CharArray(int[] ia)
Constructs a newCharArray
instance from the specified data.CharArray(int[] ia, int valueSize)
Constructs a newCharArray
instance from the specified data.CharArray(int[] ia, int to, int from)
Constructs a newCharArray
instance from the specified data.CharArray(IntList il)
Constructs a newUnsignedByteArray
instance from the specified data.CharArray(IntList il, int valueSize)
Constructs a newCharArray
instance from the specified data.CharArray(IntList il, int from, int to)
Constructs a newCharArray
instance from the specified data.
-
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
.
-
-
-
Constructor Detail
-
CharArray
public CharArray(byte[] ba)
Constructs a newCharArray
instance from the specified data. The array of bytes is interpreted as a stream of characters with the high byte preceding the low byte.- Parameters:
ba
- an array of char values expressed as pairs of bytes.- Throws:
java.lang.IllegalArgumentException
- if(ba.length % 1) != 0
java.lang.NullPointerException
- ifca == null
-
CharArray
public CharArray(char[] ca)
Constructs a newCharArray
instance from the specified data.- Parameters:
ca
- an array of integer values between 0 and Character.MAX_VALUE inclusive- Throws:
java.lang.NullPointerException
- ifca == null
-
CharArray
public CharArray(int[] ia)
Constructs a newCharArray
instance from the specified data.- Parameters:
ia
- an array of integers- Throws:
java.lang.IllegalArgumentException
- if(ia[j] < 0 || ia[j] > Character.MAX_VALUE)
for any indexj
satisfying(j >= from && j < to)
java.lang.NullPointerException
- ifia == null
-
CharArray
public CharArray(IntList il)
Constructs a newUnsignedByteArray
instance from the specified data.- Parameters:
il
- an list of integer values between 0 andCharacter.MAX_VALUE
inclusive- Throws:
java.lang.IllegalArgumentException
- if(il.get(j) < 0 || il.get(j) > Character.MAX_VALUE)
for any indexj
satisfying(j >= 0 && j < il.size())
java.lang.NullPointerException
- ifil == null
-
CharArray
public CharArray(int[] ia, int valueSize)
Constructs a newCharArray
instance from the specified data.- Parameters:
ia
- an array of nonnegative integersvalueSize
- the exclusive end of the range of non-negative array values- Throws:
java.lang.IllegalArgumentException
- if(valueSize < 1) || (valueSize >= (Character.MAX_VALUE + 1))
java.lang.IllegalArgumentException
- if(ia[j] < 0 || ia[j] > valueSize)
for any indexj
satisfying(j >= 0 && j < ia.length)
java.lang.NullPointerException
- ifia == null
-
CharArray
public CharArray(IntList il, int valueSize)
Constructs a newCharArray
instance from the specified data.- Parameters:
il
- an list of nonnegative integervalueSize
- the exclusive end of the range of non-negative array values- Throws:
java.lang.IllegalArgumentException
- if(valueSize < 1) || (valueSize >= (Character.MAX_VALUE + 1))
java.lang.IllegalArgumentException
- if(ia[j] < 0 || ia[j] > valueSize)
for any indexj
satisfying(j >= 0 && j < ia.length)
java.lang.NullPointerException
- ifil == null
-
CharArray
public CharArray(int[] ia, int to, int from)
Constructs a newCharArray
instance from the specified data.- Parameters:
ia
- an array of integer values between 0 andCharacter.MAX_VALUE
inclusiveto
- the first element to be included (inclusive)from
- the last element to be included (exclusive)- Throws:
java.lang.IllegalArgumentException
- if(ia[j] < 0 || ia[j] > Character.MAX_VALUE)
for any indexj
satisfying(j >= from && j < to)
java.lang.IndexOutOfBoundsException
- if(from < 0 || to > ia.length)
java.lang.NegativeArraySizeException
- ifto > from
java.lang.NullPointerException
- ifia == null
-
CharArray
public CharArray(IntList il, int from, int to)
Constructs a newCharArray
instance from the specified data.- Parameters:
il
- an list of integer values between 0 andCharacter.MAX_VALUE
inclusivefrom
- the first element to be included (inclusive)to
- the last element to be included (exclusive)- Throws:
java.lang.IllegalArgumentException
- if(il.get(j) < 0 || il.get(j) > Character.MAX_VALUE)
for any indexj
satisfying(j >= from && j < to)
java.lang.IndexOutOfBoundsException
- iffrom < 0 || to > il.length
java.lang.NegativeArraySizeException
- ifto > from
java.lang.NullPointerException
- ifil == null
-
-
Method Detail
-
size
public int size()
Description copied from interface:IntArray
Returns the number of elements in thisIntArray
.
-
-