Package ints
Class CharArray
- java.lang.Object
-
- ints.CharArray
-
-
Constructor Summary
Constructors Constructor Description CharArray(byte[] ba)Constructs a newCharArrayinstance from the specified data.CharArray(char[] ca)Constructs a newCharArrayinstance from the specified data.CharArray(int[] ia)Constructs a newCharArrayinstance from the specified data.CharArray(int[] ia, int valueSize)Constructs a newCharArrayinstance from the specified data.CharArray(int[] ia, int to, int from)Constructs a newCharArrayinstance from the specified data.CharArray(IntList il)Constructs a newUnsignedByteArrayinstance from the specified data.CharArray(IntList il, int valueSize)Constructs a newCharArrayinstance from the specified data.CharArray(IntList il, int from, int to)Constructs a newCharArrayinstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intget(int index)Returns the specified array element.intsize()Returns the number of elements in thisIntArray.
-
-
-
Constructor Detail
-
CharArray
public CharArray(byte[] ba)
Constructs a newCharArrayinstance 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) != 0java.lang.NullPointerException- ifca == null
-
CharArray
public CharArray(char[] ca)
Constructs a newCharArrayinstance 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 newCharArrayinstance 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 indexjsatisfying(j >= from && j < to)java.lang.NullPointerException- ifia == null
-
CharArray
public CharArray(IntList il)
Constructs a newUnsignedByteArrayinstance from the specified data.- Parameters:
il- an list of integer values between 0 andCharacter.MAX_VALUEinclusive- Throws:
java.lang.IllegalArgumentException- if(il.get(j) < 0 || il.get(j) > Character.MAX_VALUE)for any indexjsatisfying(j >= 0 && j < il.size())java.lang.NullPointerException- ifil == null
-
CharArray
public CharArray(int[] ia, int valueSize)Constructs a newCharArrayinstance 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 indexjsatisfying(j >= 0 && j < ia.length)java.lang.NullPointerException- ifia == null
-
CharArray
public CharArray(IntList il, int valueSize)
Constructs a newCharArrayinstance 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 indexjsatisfying(j >= 0 && j < ia.length)java.lang.NullPointerException- ifil == null
-
CharArray
public CharArray(int[] ia, int to, int from)Constructs a newCharArrayinstance from the specified data.- Parameters:
ia- an array of integer values between 0 andCharacter.MAX_VALUEinclusiveto- 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 indexjsatisfying(j >= from && j < to)java.lang.IndexOutOfBoundsException- if(from < 0 || to > ia.length)java.lang.NegativeArraySizeException- ifto > fromjava.lang.NullPointerException- ifia == null
-
CharArray
public CharArray(IntList il, int from, int to)
Constructs a newCharArrayinstance from the specified data.- Parameters:
il- an list of integer values between 0 andCharacter.MAX_VALUEinclusivefrom- 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 indexjsatisfying(j >= from && j < to)java.lang.IndexOutOfBoundsException- iffrom < 0 || to > il.lengthjava.lang.NegativeArraySizeException- ifto > fromjava.lang.NullPointerException- ifil == null
-
-
Method Detail
-
size
public int size()
Description copied from interface:IntArrayReturns the number of elements in thisIntArray.
-
-