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 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.Constructs a newUnsignedByteArray
instance from the specified data.Constructs a newCharArray
instance from the specified data.Constructs a newCharArray
instance from the specified data. -
Method Summary
-
Constructor Details
-
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:
IllegalArgumentException
- if(ba.length % 1) != 0
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:
NullPointerException
- ifca == null
-
CharArray
public CharArray(int[] ia) Constructs a newCharArray
instance from the specified data.- Parameters:
ia
- an array of integers- Throws:
IllegalArgumentException
- if(ia[j] < 0 || ia[j] > Character.MAX_VALUE)
for any indexj
satisfying(j >= from && j < to)
NullPointerException
- ifia == null
-
CharArray
Constructs a newUnsignedByteArray
instance from the specified data.- Parameters:
il
- an list of integer values between 0 andCharacter.MAX_VALUE
inclusive- Throws:
IllegalArgumentException
- if(il.get(j) < 0 || il.get(j) > Character.MAX_VALUE)
for any indexj
satisfying(j >= 0 && j < il.size())
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:
IllegalArgumentException
- if(valueSize < 1) || (valueSize >= (Character.MAX_VALUE + 1))
IllegalArgumentException
- if(ia[j] < 0 || ia[j] > valueSize)
for any indexj
satisfying(j >= 0 && j < ia.length)
NullPointerException
- ifia == null
-
CharArray
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:
IllegalArgumentException
- if(valueSize < 1) || (valueSize >= (Character.MAX_VALUE + 1))
IllegalArgumentException
- if(ia[j] < 0 || ia[j] > valueSize)
for any indexj
satisfying(j >= 0 && j < ia.length)
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:
IllegalArgumentException
- if(ia[j] < 0 || ia[j] > Character.MAX_VALUE)
for any indexj
satisfying(j >= from && j < to)
IndexOutOfBoundsException
- if(from < 0 || to > ia.length)
NegativeArraySizeException
- ifto > from
NullPointerException
- ifia == null
-
CharArray
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:
IllegalArgumentException
- if(il.get(j) < 0 || il.get(j) > Character.MAX_VALUE)
for any indexj
satisfying(j >= from && j < to)
IndexOutOfBoundsException
- iffrom < 0 || to > il.length
NegativeArraySizeException
- ifto > from
NullPointerException
- ifil == null
-
-
Method Details