public static class CharLists.EmptyList extends CharCollections.EmptyCollection implements CharList, java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char k) |
boolean |
add(java.lang.Character k)
Delegates to the corresponding type-specific method.
|
void |
add(int index,
char k) |
void |
add(int index,
java.lang.Character k) |
boolean |
addAll(CharCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(CharList c) |
boolean |
addAll(java.util.Collection<? extends java.lang.Character> c)
Adds all elements of the given collection to this collection.
|
boolean |
addAll(int i,
CharCollection c) |
boolean |
addAll(int i,
CharList c) |
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.Character> c) |
void |
addElements(int index,
char[] a)
Add (hopefully quickly) elements to this type-specific list.
|
void |
addElements(int index,
char[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
CharIterator |
charIterator()
Deprecated.
|
CharListIterator |
charListIterator()
Deprecated.
|
CharListIterator |
charListIterator(int i)
Deprecated.
|
CharList |
charSubList(int from,
int to)
Deprecated.
|
java.lang.Object |
clone() |
int |
compareTo(java.util.List<? extends java.lang.Character> o) |
boolean |
equals(java.lang.Object o) |
java.lang.Character |
get(int i) |
char |
getChar(int i) |
void |
getElements(int from,
char[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array.
|
int |
hashCode() |
int |
indexOf(char k) |
int |
indexOf(java.lang.Object k) |
CharListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
int |
lastIndexOf(char k) |
int |
lastIndexOf(java.lang.Object k) |
CharListIterator |
listIterator()
Returns a type-specific list iterator on the list.
|
CharListIterator |
listIterator(int i)
Returns a type-specific list iterator on the list starting at a given index.
|
java.lang.Character |
remove(int k) |
boolean |
removeAll(java.util.Collection<?> c)
Remove from this collection all elements in the given collection.
|
char |
removeChar(int i) |
void |
removeElements(int from,
int to)
Removes (hopefully quickly) elements of this type-specific list.
|
char |
set(int index,
char k) |
java.lang.Character |
set(int index,
java.lang.Character k) |
void |
size(int s)
Sets the size 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. |
java.lang.String |
toString() |
clear, contains, containsAll, rem, removeAll, retainAll, size, toArray, toCharArray, toCharArraycontains, containsAll, isEmpty, rem, remove, retainAll, toArray, toArrayclear, contains, containsAll, isEmpty, remove, replaceAll, retainAll, size, sort, spliterator, toArray, toArraycontains, containsAll, rem, removeAll, retainAll, toArray, toArray, toCharArray, toCharArraypublic void add(int index,
char k)
public boolean add(char k)
add in interface CharCollectionadd in interface CharListadd in class CharCollections.EmptyCollectionCollection.add(Object)public char removeChar(int i)
removeChar in interface CharListList.remove(int)public char set(int index,
char k)
public int indexOf(char k)
public int lastIndexOf(char k)
lastIndexOf in interface CharListList.lastIndexOf(Object)public boolean addAll(java.util.Collection<? extends java.lang.Character> c)
AbstractCharCollectionaddAll in interface java.util.Collection<java.lang.Character>addAll in interface java.util.List<java.lang.Character>addAll in class AbstractCharCollectionc - a collection.true if this collection changed as a result of the call.public boolean addAll(int i,
java.util.Collection<? extends java.lang.Character> c)
addAll in interface java.util.List<java.lang.Character>public boolean removeAll(java.util.Collection<?> c)
AbstractCharCollectionremoveAll in interface java.util.Collection<java.lang.Character>removeAll in interface java.util.List<java.lang.Character>removeAll in class AbstractCharCollectionc - a collection.true if this collection changed as a result of the call.public java.lang.Character get(int i)
get in interface java.util.List<java.lang.Character>public boolean addAll(CharCollection c)
AbstractCharCollectionaddAll in interface CharCollectionaddAll in class CharCollections.EmptyCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean addAll(CharList c)
public boolean addAll(int i,
CharCollection c)
public boolean addAll(int i,
CharList c)
public void add(int index,
java.lang.Character k)
add in interface java.util.List<java.lang.Character>public boolean add(java.lang.Character k)
AbstractCharCollectionadd in interface java.util.Collection<java.lang.Character>add in interface java.util.List<java.lang.Character>add in class AbstractCharCollectionpublic java.lang.Character set(int index,
java.lang.Character k)
set in interface java.util.List<java.lang.Character>public char getChar(int i)
public java.lang.Character remove(int k)
remove in interface java.util.List<java.lang.Character>public int indexOf(java.lang.Object k)
indexOf in interface java.util.List<java.lang.Character>public int lastIndexOf(java.lang.Object k)
lastIndexOf in interface java.util.List<java.lang.Character>@Deprecated public CharIterator charIterator()
AbstractCharCollectioncharIterator in interface CharCollectioncharIterator in class AbstractCharCollectionCharCollection.iterator()public CharListIterator listIterator()
CharListlistIterator in interface CharListlistIterator in interface java.util.List<java.lang.Character>List.listIterator()public CharListIterator iterator()
CharCollectionNote that this specification strengthens the one given in
Iterable.iterator(), which was already
strengthened in the corresponding type-specific class,
but was weakened by the fact that this interface extends Collection.
iterator in interface CharCollectioniterator in interface CharIterableiterator in interface CharListiterator in interface java.lang.Iterable<java.lang.Character>iterator in interface java.util.Collection<java.lang.Character>iterator in interface java.util.List<java.lang.Character>iterator in class CharCollections.EmptyCollectionpublic CharListIterator listIterator(int i)
CharListlistIterator in interface CharListlistIterator in interface java.util.List<java.lang.Character>List.listIterator(int)@Deprecated public CharListIterator charListIterator()
CharListcharListIterator in interface CharListCharList.listIterator()@Deprecated public CharListIterator charListIterator(int i)
CharListcharListIterator in interface CharListCharList.listIterator(int)public CharList subList(int from, int to)
CharListfrom, inclusive, to the index to, exclusive.
Note that this specification strengthens the one given in List.subList(int,int).
@Deprecated public CharList charSubList(int from, int to)
CharListfrom, inclusive, to the index to, exclusive.charSubList in interface CharListList.subList(int,int)public void getElements(int from,
char[] a,
int offset,
int length)
CharListgetElements in interface CharListfrom - 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)
CharListremoveElements in interface CharListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
char[] a,
int offset,
int length)
CharListaddElements in interface CharListindex - 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 addElements(int index,
char[] a)
CharListaddElements in interface CharListindex - the index at which to add elements.a - the array containing the elements.public void size(int s)
CharListIf the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null/false.
public int compareTo(java.util.List<? extends java.lang.Character> o)
compareTo in interface java.lang.Comparable<java.util.List<? extends java.lang.Character>>public java.lang.Object clone()
clone in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<java.lang.Character>hashCode in interface java.util.List<java.lang.Character>hashCode in class CharCollections.EmptyCollectionpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collection<java.lang.Character>equals in interface java.util.List<java.lang.Character>equals in class CharCollections.EmptyCollectionpublic java.lang.String toString()
toString in class AbstractCharCollection