public interface CharBigList extends BigList<java.lang.Character>, CharCollection, java.lang.Comparable<BigList<? extends java.lang.Character>>
BigList
; provides some additional methods that use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens iterator()
, listIterator()
,
listIterator(long)
and subList(long,long)
.
Besides polymorphic methods, this interfaces specifies methods to copy into an array or remove contiguous sublists. Although the abstract implementation of this interface provides simple, one-by-one implementations of these methods, it is expected that concrete implementation override them with optimized versions.
List
Modifier and Type | Method and Description |
---|---|
void |
add(long index,
char key)
Inserts the specified element at the specified position in this type-specific big list (optional operation).
|
void |
add(long index,
java.lang.Character key)
Deprecated.
Please use the corresponding type-specific method instead.
|
default boolean |
addAll(CharBigList l)
Appends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).
|
default boolean |
addAll(CharList l)
Appends all of the elements in the specified type-specific list to the end of this type-specific big list (optional operation).
|
default boolean |
addAll(long index,
CharBigList l)
Inserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).
|
boolean |
addAll(long index,
CharCollection c)
Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).
|
default boolean |
addAll(long index,
CharList l)
Inserts all of the elements in the specified type-specific list into this type-specific big list at the specified position (optional operation).
|
void |
addElements(long index,
char[][] a)
Add (hopefully quickly) elements to this type-specific big list.
|
void |
addElements(long index,
char[][] a,
long offset,
long length)
Add (hopefully quickly) elements to this type-specific big list.
|
java.lang.Character |
get(long index)
Deprecated.
Please use the corresponding type-specific method instead.
|
char |
getChar(long index)
Returns the element at the specified position.
|
void |
getElements(long from,
char[][] a,
long offset,
long length)
Copies (hopefully quickly) elements of this type-specific big list into the given big array.
|
long |
indexOf(char k)
Returns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
|
long |
indexOf(java.lang.Object o)
Deprecated.
Please use the corresponding type-specific method instead.
|
CharBigListIterator |
iterator()
Returns a type-specific iterator on the elements of this list.
|
long |
lastIndexOf(char k)
Returns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
|
long |
lastIndexOf(java.lang.Object o)
Deprecated.
Please use the corresponding type-specific method instead.
|
CharBigListIterator |
listIterator()
Returns a type-specific big-list iterator on this type-specific big list.
|
CharBigListIterator |
listIterator(long index)
Returns a type-specific list iterator on this type-specific big list starting at a given index.
|
java.lang.Character |
remove(long index)
Deprecated.
Please use the corresponding type-specific method instead.
|
char |
removeChar(long index)
Removes the element at the specified position.
|
void |
removeElements(long from,
long to)
Removes (hopefully quickly) elements of this type-specific big list.
|
char |
set(long index,
char k)
Replaces the element at the specified position in this big list with the specified element (optional operation).
|
java.lang.Character |
set(long index,
java.lang.Character k)
Deprecated.
Please use the corresponding type-specific method instead.
|
default void |
setElements(char[][] a)
Set (hopefully quickly) elements to match the array given.
|
default void |
setElements(long index,
char[][] a)
Set (hopefully quickly) elements to match the array given.
|
default void |
setElements(long index,
char[][] a,
long offset,
long length)
Set (hopefully quickly) elements to match the array given.
|
default CharSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this big-list.
|
CharBigList |
subList(long from,
long to)
Returns a type-specific view of the portion of this type-specific big list from the index
from , inclusive, to the index to , exclusive. |
add, add, addAll, contains, contains, containsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, rem, remove, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toCharArray, toCharArray
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
forEach, forEach, forEach
CharBigListIterator iterator()
iterator
in interface CharCollection
iterator
in interface CharIterable
iterator
in interface java.util.Collection<java.lang.Character>
iterator
in interface java.lang.Iterable<java.lang.Character>
Collection.iterator()
Collection.iterator()
.CharBigListIterator listIterator()
listIterator
in interface BigList<java.lang.Character>
BigList.listIterator()
BigList.listIterator()
.CharBigListIterator listIterator(long index)
listIterator
in interface BigList<java.lang.Character>
index
- index of first element to be returned from the big-list iterator.BigList.listIterator(long)
BigList.listIterator(long)
.default CharSpliterator spliterator()
BigList spliterators must report at least Spliterator.SIZED
and Spliterator.ORDERED
.
See List.spliterator()
for more documentation on the requirements
of the returned spliterator (despite BigList
not being a List
, most of the
same requirements apply.
spliterator
in interface CharCollection
spliterator
in interface CharIterable
spliterator
in interface java.util.Collection<java.lang.Character>
spliterator
in interface java.lang.Iterable<java.lang.Character>
spliterator
method subclasses should override.Spliterator
for documentation on what binding policies mean).
RandomAccess
lists, this will return a spliterator
that calls the type-specific get(long)
method on the appropriate indexes.iterator()
.In either case, the spliterator reports Spliterator.SIZED
,
Spliterator.SUBSIZED
, and Spliterator.ORDERED
.
Iterator
is an inherently linear API, the returned
spliterator will yield limited performance gains when run in parallel contexts, as the
returned spliterator's trySplit()
will have linear runtime.
For RandomAccess
lists, the parallel performance should
be reasonable assuming get(long)
is truly constant time like RandomAccess
suggests.
CharBigList subList(long from, long to)
from
, inclusive, to the index to
, exclusive.subList
in interface BigList<java.lang.Character>
from
- the starting element (inclusive).to
- the ending element (exclusive).BigList.subList(long,long)
BigList.subList(long,long)
.void getElements(long from, char[][] a, long offset, long length)
from
- the start index (inclusive).a
- the destination big array.offset
- the offset into the destination big array where to store the first element copied.length
- the number of elements to be copied.void removeElements(long from, long to)
from
- the start index (inclusive).to
- the end index (exclusive).void addElements(long index, char[][] a)
index
- the index at which to add elements.a
- the big array containing the elements.void addElements(long index, char[][] a, long offset, long length)
index
- the index at which to add elements.a
- the big array containing the elements.offset
- the offset of the first element to add.length
- the number of elements to add.default void setElements(char[][] a)
a
- the big array containing the elements.default void setElements(long index, char[][] a)
index
- the index at which to start setting elements.a
- the big array containing the elements.default void setElements(long index, char[][] a, long offset, long length)
ListIterator iter = listIterator(index); long i = 0; while (i < length) { iter.next(); iter.set(BigArrays.get(a, offset + i++); }However, the exact implementation may be more efficient, taking into account whether random access is faster or not, or at the discretion of subclasses, abuse internals.
index
- the index at which to start setting elements.a
- the big array containing the elements.offset
- the offset of the first element to add.length
- the number of elements to add.void add(long index, char key)
BigList.add(long,Object)
boolean addAll(long index, CharCollection c)
List.addAll(int,java.util.Collection)
char getChar(long index)
BigList.get(long)
char removeChar(long index)
BigList.remove(long)
char set(long index, char k)
BigList.set(long,Object)
long indexOf(char k)
BigList.indexOf(Object)
long lastIndexOf(char k)
BigList.lastIndexOf(Object)
@Deprecated void add(long index, java.lang.Character key)
@Deprecated java.lang.Character get(long index)
@Deprecated long indexOf(java.lang.Object o)
@Deprecated long lastIndexOf(java.lang.Object o)
lastIndexOf
in interface BigList<java.lang.Character>
o
- the object to search for.List.lastIndexOf(Object)
@Deprecated java.lang.Character remove(long index)
@Deprecated java.lang.Character set(long index, java.lang.Character k)
default boolean addAll(long index, CharBigList l)
BigList.addAll(long,Collection)
getElements(long, char[][], long, long)
/addElements(long, char[][])
.default boolean addAll(CharBigList l)
Collection.addAll(Collection)
BigList.size()
as first argument.default boolean addAll(long index, CharList l)
BigList.addAll(long,Collection)
getElements(long, char[][], long, long)
/addElements(long, char[][])
.default boolean addAll(CharList l)
Collection.addAll(Collection)
BigList.size()
as first argument.