Package ints
Class CharArray
java.lang.Object
ints.CharArray
- All Implemented Interfaces:
IntArray
/**
Class UnsignedByteArray represents an immutable
array of integer values between 0 and 65,535 inclusive that is stored
as a char[] array.
CharArray are immutable.-
Constructor Summary
ConstructorsConstructorDescriptionCharArray(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.Constructs a newUnsignedByteArrayinstance from the specified data.Constructs a newCharArrayinstance from the specified data.Constructs a newCharArrayinstance from the specified data. -
Method Summary
-
Constructor Details
-
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:
IllegalArgumentException- if(ba.length % 1) != 0NullPointerException- 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:
NullPointerException- ifca == null
-
CharArray
public CharArray(int[] ia) Constructs a newCharArrayinstance from the specified data.- Parameters:
ia- an array of integers- Throws:
IllegalArgumentException- if(ia[j] < 0 || ia[j] > Character.MAX_VALUE)for any indexjsatisfying(j >= from && j < to)NullPointerException- ifia == null
-
CharArray
Constructs a newUnsignedByteArrayinstance from the specified data.- Parameters:
il- an list of integer values between 0 andCharacter.MAX_VALUEinclusive- Throws:
IllegalArgumentException- if(il.get(j) < 0 || il.get(j) > Character.MAX_VALUE)for any indexjsatisfying(j >= 0 && j < il.size())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:
IllegalArgumentException- if(valueSize < 1) || (valueSize >= (Character.MAX_VALUE + 1))IllegalArgumentException- if(ia[j] < 0 || ia[j] > valueSize)for any indexjsatisfying(j >= 0 && j < ia.length)NullPointerException- ifia == null
-
CharArray
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:
IllegalArgumentException- if(valueSize < 1) || (valueSize >= (Character.MAX_VALUE + 1))IllegalArgumentException- if(ia[j] < 0 || ia[j] > valueSize)for any indexjsatisfying(j >= 0 && j < ia.length)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:
IllegalArgumentException- if(ia[j] < 0 || ia[j] > Character.MAX_VALUE)for any indexjsatisfying(j >= from && j < to)IndexOutOfBoundsException- if(from < 0 || to > ia.length)NegativeArraySizeException- ifto > fromNullPointerException- ifia == null
-
CharArray
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:
IllegalArgumentException- if(il.get(j) < 0 || il.get(j) > Character.MAX_VALUE)for any indexjsatisfying(j >= from && j < to)IndexOutOfBoundsException- iffrom < 0 || to > il.lengthNegativeArraySizeException- ifto > fromNullPointerException- ifil == null
-
-
Method Details