Class AbstractCharList.CharSubList
- java.lang.Object
-
- java.util.AbstractCollection<Character>
-
- org.codelibs.jhighlight.fastutil.chars.AbstractCharCollection
-
- org.codelibs.jhighlight.fastutil.chars.AbstractCharList
-
- org.codelibs.jhighlight.fastutil.chars.AbstractCharList.CharSubList
-
- All Implemented Interfaces:
Serializable,Comparable<List<? extends Character>>,Iterable<Character>,Collection<Character>,List<Character>,CharCollection,CharIterable,CharList,CharStack,Stack<Character>
- Enclosing class:
- AbstractCharList
public static class AbstractCharList.CharSubList extends AbstractCharList implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.codelibs.jhighlight.fastutil.chars.AbstractCharList
AbstractCharList.CharSubList
-
-
Constructor Summary
Constructors Constructor Description CharSubList(CharList l, int from, int to)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(char k)voidadd(int index, char k)booleanaddAll(int index, Collection<? extends Character> c)booleanaddAll(int index, CharCollection c)Delegates to a more generic method.booleanaddAll(int index, CharList l)Delegates to a more generic method.voidaddElements(int index, char[] a, int offset, int length)Adds elements to this type-specific list one-by-one.voidclear()chargetChar(int index)voidgetElements(int from, char[] a, int offset, int length)Copies element of this type-specific list into the given array one-by-one.CharListIteratorlistIterator(int index)Returns a type-specific list iterator on the list starting at a given index.booleanrem(char k)booleanremove(Object o)Delegates torem().charremoveChar(int index)voidremoveElements(int from, int to)Removes elements of this type-specific list one-by-one.charset(int index, char k)intsize()CharListsubList(int from, int to)Returns a type-specific view of the portion of this list from the indexfrom, inclusive, to the indexto, exclusive.-
Methods inherited from class org.codelibs.jhighlight.fastutil.chars.AbstractCharList
add, addAll, addAll, addAll, addElements, charListIterator, charListIterator, charSubList, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, get, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekChar, pop, popChar, push, push, remove, set, size, top, topChar, toString
-
Methods inherited from class org.codelibs.jhighlight.fastutil.chars.AbstractCharCollection
add, charIterator, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toCharArray, toCharArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.codelibs.jhighlight.fastutil.chars.CharCollection
charIterator, containsAll, removeAll, retainAll, toArray, toArray, toCharArray, toCharArray
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Field Detail
-
l
protected final CharList l
The list this sublist restricts.
-
from
protected final int from
Initial (inclusive) index of this sublist.
-
to
protected int to
Final (exclusive) index of this sublist.
-
-
Constructor Detail
-
CharSubList
public CharSubList(CharList l, int from, int to)
-
-
Method Detail
-
add
public boolean add(char k)
- Specified by:
addin interfaceCharCollection- Specified by:
addin interfaceCharList- Overrides:
addin classAbstractCharList- See Also:
Collection.add(Object)
-
add
public void add(int index, char k)- Specified by:
addin interfaceCharList- Overrides:
addin classAbstractCharList- See Also:
List.add(int,Object)
-
addAll
public boolean addAll(int index, Collection<? extends Character> c)- Specified by:
addAllin interfaceList<Character>- Overrides:
addAllin classAbstractCharList
-
getChar
public char getChar(int index)
- Specified by:
getCharin interfaceCharList- See Also:
List.get(int)
-
removeChar
public char removeChar(int index)
- Specified by:
removeCharin interfaceCharList- Overrides:
removeCharin classAbstractCharList- See Also:
List.remove(int)
-
set
public char set(int index, char k)- Specified by:
setin interfaceCharList- Overrides:
setin classAbstractCharList- See Also:
List.set(int,Object)
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<Character>- Specified by:
clearin interfaceList<Character>- Overrides:
clearin classAbstractCollection<Character>
-
size
public int size()
- Specified by:
sizein interfaceCollection<Character>- Specified by:
sizein interfaceList<Character>- Specified by:
sizein classAbstractCollection<Character>
-
getElements
public void getElements(int from, char[] a, int offset, int length)Description copied from class:AbstractCharListCopies element of this type-specific list into the given array one-by-one.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
getElementsin interfaceCharList- Overrides:
getElementsin classAbstractCharList- Parameters:
from- 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.
-
removeElements
public void removeElements(int from, int to)Description copied from class:AbstractCharListRemoves elements of this type-specific list one-by-one.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
removeElementsin interfaceCharList- Overrides:
removeElementsin classAbstractCharList- Parameters:
from- the start index (inclusive).to- the end index (exclusive).
-
addElements
public void addElements(int index, char[] a, int offset, int length)Description copied from class:AbstractCharListAdds elements to this type-specific list one-by-one.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
addElementsin interfaceCharList- Overrides:
addElementsin classAbstractCharList- Parameters:
index- 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.
-
listIterator
public CharListIterator listIterator(int index)
Description copied from interface:CharListReturns a type-specific list iterator on the list starting at a given index.- Specified by:
listIteratorin interfaceCharList- Specified by:
listIteratorin interfaceList<Character>- Overrides:
listIteratorin classAbstractCharList- See Also:
List.listIterator(int)
-
subList
public CharList subList(int from, int to)
Description copied from interface:CharListReturns a type-specific view of the portion of this list from the indexfrom, inclusive, to the indexto, exclusive.Note that this specification strengthens the one given in
List.subList(int,int).- Specified by:
subListin interfaceCharList- Specified by:
subListin interfaceList<Character>- Overrides:
subListin classAbstractCharList- See Also:
List.subList(int,int)
-
rem
public boolean rem(char k)
Description copied from interface:CharCollectionNote that this method should be calledremove(), but the clash with the similarly named index-based method in theListinterface forces us to use a distinguished name. For simplicity, the set interfaces reinstatesremove().- Specified by:
remin interfaceCharCollection- Overrides:
remin classAbstractCharList- See Also:
Collection.remove(Object)
-
remove
public boolean remove(Object o)
Description copied from class:AbstractCharListDelegates torem().- Specified by:
removein interfaceCollection<Character>- Specified by:
removein interfaceList<Character>- Overrides:
removein classAbstractCharList
-
addAll
public boolean addAll(int index, CharCollection c)Description copied from class:AbstractCharListDelegates to a more generic method.- Specified by:
addAllin interfaceCharList- Overrides:
addAllin classAbstractCharList- See Also:
List.add(int,Object)
-
addAll
public boolean addAll(int index, CharList l)Description copied from class:AbstractCharListDelegates to a more generic method.- Specified by:
addAllin interfaceCharList- Overrides:
addAllin classAbstractCharList- See Also:
List.add(int,Object)
-
-