public static class AbstractCharList.CharSubList extends AbstractCharList implements java.io.Serializable
AbstractCharList.CharRandomAccessSubList, AbstractCharList.CharSubList| Modifier and Type | Field and Description |
|---|---|
protected int |
from
Initial (inclusive) index of this sublist.
|
protected CharList |
l
The list this sublist restricts.
|
protected int |
to
Final (exclusive) index of this sublist.
|
| Constructor and Description |
|---|
CharSubList(CharList l,
int from,
int to) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char k)
Ensures that this collection contains the specified element (optional operation).
|
void |
add(int index,
char k)
Inserts the specified element at the specified position in this list (optional operation).
|
boolean |
addAll(int index,
CharCollection c)
Inserts all of the elements in the specified type-specific collection into this type-specific list at the specified position (optional operation).
|
boolean |
addAll(int index,
CharList l)
Inserts all of the elements in the specified type-specific list into this type-specific list at the specified position (optional operation).
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Character> c)
Adds all of the elements in the specified collection to this list (optional operation).
|
void |
addElements(int index,
char[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
char |
getChar(int index)
Returns the element at the specified position in this list.
|
void |
getElements(int from,
char[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array.
|
CharListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(char k)
Removes a single instance of the specified element from this collection, if it is present (optional operation).
|
char |
removeChar(int index)
Removes the element at the specified position in this list (optional operation).
|
void |
removeElements(int from,
int to)
Removes (hopefully quickly) elements of this type-specific list.
|
char |
set(int index,
char k)
Replaces the element at the specified position in this list with the specified element (optional operation).
|
void |
setElements(int index,
char[] a,
int offset,
int length)
Set (hopefully quickly) elements to match the array given.
|
int |
size() |
it.unimi.dsi.fastutil.chars.CharSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this list.
|
CharList |
subList(int from,
int to)
Returns a type-specific view of the portion of this list from the index
from, inclusive, to the index to, exclusive. |
addAll, addAll, addElements, clear, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, forEach, hashCode, indexOf, iterator, lastIndexOf, listIterator, peekChar, popChar, push, size, toArray, toCharArray, topChar, toStringadd, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toCharArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, contains, get, indexOf, lastIndexOf, of, of, of, of, of, remove, remove, replaceAll, replaceAll, replaceAll, set, setElements, setElements, sort, sort, unstableSort, unstableSortcontainsAll, isEmpty, removeAll, retainAll, toArray, toArraycontainsAll, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toCharArrayforEach, forEachprotected final CharList l
protected final int from
protected int to
public CharSubList(CharList l, int from, int to)
public boolean add(char k)
AbstractCharListadd in interface CharCollectionadd in interface CharListadd in class AbstractCharListCollection.add(Object)public void add(int index,
char k)
AbstractCharListadd in interface CharListadd in class AbstractCharListList.add(int,Object)public boolean addAll(int index,
java.util.Collection<? extends java.lang.Character> c)
AbstractCharListaddAll in interface java.util.List<java.lang.Character>addAll in class AbstractCharListpublic char getChar(int index)
CharListpublic char removeChar(int index)
AbstractCharListremoveChar in interface CharListremoveChar in class AbstractCharListList.remove(int)public char set(int index,
char k)
AbstractCharListset in interface CharListset in class AbstractCharListList.set(int,Object)public int size()
size in interface java.util.Collection<java.lang.Character>size in interface java.util.List<java.lang.Character>size in class java.util.AbstractCollection<java.lang.Character>public void getElements(int from,
char[] a,
int offset,
int length)
AbstractCharListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface CharListgetElements in class AbstractCharListfrom - the start index (inclusive).a - the destination array.offset - the offset into the destination array where to store the first element copied.length - the number of elements to be copied.public void removeElements(int from,
int to)
AbstractCharListThis is a trivial iterator-based based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface CharListremoveElements in class AbstractCharListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
char[] a,
int offset,
int length)
AbstractCharListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface CharListaddElements in class AbstractCharListindex - the index at which to add elements.a - the array containing the elements.offset - the offset of the first element to add.length - the number of elements to add.public void setElements(int index,
char[] a,
int offset,
int length)
CharList
ListIterator iter = listIterator(index);
int i = 0;
while (i < length) {
iter.next();
iter.set(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.setElements in interface CharListsetElements in class AbstractCharListindex - the index at which to start setting elements.a - the array containing the elementsoffset - the offset of the first element to add.length - the number of elements to add.public CharListIterator listIterator(int index)
AbstractCharListlistIterator in interface CharListlistIterator in interface java.util.List<java.lang.Character>listIterator in class AbstractCharListList.listIterator(int)public it.unimi.dsi.fastutil.chars.CharSpliterator spliterator()
CharListList spliterators must report at least Spliterator.SIZED and Spliterator.ORDERED.
See List.spliterator() for more documentation on the requirements
of the returned spliterator.
spliterator in interface CharCollectionspliterator in interface CharIterablespliterator in interface CharListspliterator in interface java.lang.Iterable<java.lang.Character>spliterator in interface java.util.Collection<java.lang.Character>spliterator in interface java.util.List<java.lang.Character>public CharList subList(int from, int to)
CharListfrom, inclusive, to the index to, exclusive.subList in interface CharListsubList in interface java.util.List<java.lang.Character>subList in class AbstractCharListList.subList(int,int)public boolean rem(char k)
AbstractCharListrem in interface CharCollectionrem in class AbstractCharListList.remove(Object)public boolean addAll(int index,
CharCollection c)
CharListaddAll in interface CharListaddAll in class AbstractCharListList.addAll(int,java.util.Collection)