public static class AbstractCharList.CharSubList extends AbstractCharList implements Serializable
AbstractCharList.CharSubList
Constructor and Description |
---|
AbstractCharList.CharSubList(CharList l,
int from,
int to) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(char k) |
void |
add(int index,
char k) |
boolean |
addAll(int index,
CharCollection c)
Delegates to a more generic method.
|
boolean |
addAll(int index,
CharList l)
Delegates to a more generic method.
|
boolean |
addAll(int index,
Collection<? extends Character> c) |
void |
addElements(int index,
char[] a,
int offset,
int length)
Adds elements to this type-specific list one-by-one.
|
void |
clear() |
char |
getChar(int index) |
void |
getElements(int from,
char[] a,
int offset,
int length)
Copies element of this type-specific list into the given array one-by-one.
|
CharListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(char k)
|
boolean |
remove(Object o)
Delegates to
rem() . |
char |
removeChar(int index) |
void |
removeElements(int from,
int to)
Removes elements of this type-specific list one-by-one.
|
char |
set(int index,
char k) |
int |
size() |
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. |
add, addAll, addAll, addAll, addElements, charListIterator, charListIterator, charSubList, compareTo, contains, equals, get, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekChar, pop, popChar, push, push, remove, set, size, top, topChar, toString
add, charIterator, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toCharArray, toCharArray
add, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray
charIterator, containsAll, removeAll, retainAll, toArray, toArray, toCharArray, toCharArray
public AbstractCharList.CharSubList(CharList l, int from, int to)
public boolean add(char k)
add
in interface CharCollection
add
in interface CharList
add
in class AbstractCharList
Collection.add(Object)
public void add(int index, char k)
add
in interface CharList
add
in class AbstractCharList
List.add(int,Object)
public boolean addAll(int index, Collection<? extends Character> c)
addAll
in interface List<Character>
addAll
in class AbstractCharList
public char getChar(int index)
getChar
in interface CharList
List.get(int)
public char removeChar(int index)
removeChar
in interface CharList
removeChar
in class AbstractCharList
List.remove(int)
public char set(int index, char k)
set
in interface CharList
set
in class AbstractCharList
List.set(int,Object)
public void clear()
clear
in interface Collection<Character>
clear
in interface List<Character>
clear
in class AbstractCollection<Character>
public int size()
size
in interface Collection<Character>
size
in interface List<Character>
size
in class AbstractCollection<Character>
public void getElements(int from, char[] a, int offset, int length)
AbstractCharList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements
in interface CharList
getElements
in class AbstractCharList
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.public void removeElements(int from, int to)
AbstractCharList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface CharList
removeElements
in class AbstractCharList
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, char[] a, int offset, int length)
AbstractCharList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements
in interface CharList
addElements
in class AbstractCharList
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.public CharListIterator listIterator(int index)
CharList
listIterator
in interface CharList
listIterator
in interface List<Character>
listIterator
in class AbstractCharList
List.listIterator(int)
public CharList subList(int from, int to)
CharList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in List.subList(int,int)
.
subList
in interface CharList
subList
in interface List<Character>
subList
in class AbstractCharList
List.subList(int,int)
public boolean rem(char k)
CharCollection
remove()
, but the clash
with the similarly named index-based method in the List
interface
forces us to use a distinguished name. For simplicity, the set interfaces reinstates
remove()
.rem
in interface CharCollection
rem
in class AbstractCharList
Collection.remove(Object)
public boolean remove(Object o)
AbstractCharList
rem()
.remove
in interface Collection<Character>
remove
in interface List<Character>
remove
in class AbstractCharList
public boolean addAll(int index, CharCollection c)
AbstractCharList
addAll
in interface CharList
addAll
in class AbstractCharList
List.add(int,Object)
public boolean addAll(int index, CharList l)
AbstractCharList
addAll
in interface CharList
addAll
in class AbstractCharList
List.add(int,Object)