public interface ILcdCharList extends List<Character>, ILcdCloneable
List
interface that is optimized for chars.
It provides extra methods using char primitives, instead of Character
objects.Modifier and Type | Method and Description |
---|---|
default boolean |
addAll(char[] aValues)
Equivalent to
addAll(size(), aValues, 0, aValues.length . |
default boolean |
addAll(char[] aValues,
int aOffset,
int aLength)
Equivalent to
addAll(size(), aValues, aOffset, aLength . |
default boolean |
addAll(int aStartIndex,
char[] aValues)
Equivalent to
addAll(aStartIndex, aValues, 0, aValues.length . |
default boolean |
addAll(int aStartIndex,
char[] aValues,
int aOffset,
int aLength)
Adds
aLength integer values from the given array to this list, starting from the given aOffset |
boolean |
addChar(char aValue)
Appends the specified value to the end of this list (optional operation).
|
void |
addChar(int aIndex,
char aValue)
Inserts the specified value at the specified position in this list (optional operation).
|
ILcdCharList |
clone()
Creates and returns a copy of this object.
|
boolean |
containsChar(char aValue)
Returns
true if this list contains the specified value. |
char |
getChar(int aIndex)
Returns the value at the specified position in this list.
|
int |
indexOfChar(char aValue)
Returns the index of the first occurrence of the specified value in this list, or -1 if this list does not
contain the value.
|
int |
lastIndexOfChar(char aValue)
Returns the index of the last occurrence of the specified value in this list, or -1 if this list does not
contain the value.
|
boolean |
removeChar(char aValue)
Removes the first occurrence of the specified value from this list, if it is present (optional operation).
|
char |
removeChar(int aIndex)
Removes the value at the specified position in this list (optional operation).
|
char |
setChar(int aIndex,
char aValue)
Replaces the value at the specified position in this list with the specified value (optional operation).
|
char[] |
toCharArray()
Returns an array containing all of the values in this list in proper sequence (from first to last value).
|
char[] |
toCharArray(char[] anArray)
Returns an array containing all of the values in this list in proper sequence (from first to last value);
If the list fits in the specified array, t is returned therein.
|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
parallelStream, removeIf, stream
char getChar(int aIndex)
aIndex
- index of the value to returnIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
.char setChar(int aIndex, char aValue)
aIndex
- index of the value to replaceaValue
- value to be stored at the specified positionUnsupportedOperationException
- if the set operation is not supported by this listIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
boolean addChar(char aValue)
aValue
- value to be appended to this listtrue
UnsupportedOperationException
- if the add operation is not supported by this listvoid addChar(int aIndex, char aValue)
aIndex
- index at which the specified value is to be insertedaValue
- value to be insertedUnsupportedOperationException
- if the add operation is not supported by this listIndexOutOfBoundsException
- if the index is out of range (index < 0 || index > size())
default boolean addAll(char[] aValues)
addAll(size(), aValues, 0, aValues.length
.addAll(int, char[], int, int)
default boolean addAll(char[] aValues, int aOffset, int aLength)
addAll(size(), aValues, aOffset, aLength
.addAll(int, char[], int, int)
default boolean addAll(int aStartIndex, char[] aValues)
addAll(aStartIndex, aValues, 0, aValues.length
.addAll(int, char[], int, int)
default boolean addAll(int aStartIndex, char[] aValues, int aOffset, int aLength)
aLength
integer values from the given array to this list, starting from the given aOffset
aStartIndex
- The position in this list where to start inserting the given integer values.aValues
- The array containing the integer values to add to this listaOffset
- The offset in aValues
from where to start copying the integer valuesaLength
- The number of integer values to copy from aValues
to this list.IndexOutOfBoundsException
- if aStartIndex
is less than zero or larger than the current size of this list.IndexOutOfBoundsException
- if aOffset
+ aLength
exceeds the length of aValues
IndexOutOfBoundsException
- if aOffset
is negativeIndexOutOfBoundsException
- if aLength
is negativeboolean removeChar(char aValue)
true
if this list contained the specified value (or equivalently, if this list changed as a
result of the call).aValue
- value to be removed from this list, if presenttrue
if this list contained the specified valueUnsupportedOperationException
- if the remove operation is not supported by this listchar removeChar(int aIndex)
aIndex
- the index of the value to be removedUnsupportedOperationException
- if the remove operation is not supported by this listIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
char[] toCharArray()
char[] toCharArray(char[] anArray)
anArray
- the array into which the values of this list are to be stored, if it is big enough; otherwise,
a new array is allocated for this purpose.NullPointerException
- if the specified array is nullboolean containsChar(char aValue)
true
if this list contains the specified value.aValue
- value whose presence in this list is to be testedtrue
if this list contains the specified valueint indexOfChar(char aValue)
aValue
- value to search forint lastIndexOfChar(char aValue)
aValue
- value to search forILcdCharList clone()
clone
in interface ILcdCloneable
Object.clone()