public abstract class AbstractCharCollection extends AbstractCollection<Character> implements CharCollection
In particular, this class provide iterator(), add(), remove(Object) and contains(Object) methods that just call the type-specific counterpart.
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char k) |
boolean |
add(Character o)
Delegates to the corresponding type-specific method.
|
boolean |
addAll(CharCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(Collection<? extends Character> c)
Adds all elements of the given collection to this collection.
|
CharIterator |
charIterator()
Deprecated.
|
boolean |
contains(char k) |
boolean |
contains(Object o)
Delegates to the corresponding type-specific method.
|
boolean |
containsAll(CharCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
boolean |
containsAll(Collection<?> c)
Checks whether this collection contains all elements from the given collection.
|
boolean |
isEmpty() |
abstract CharIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
rem(char k)
|
boolean |
rem(Object o)
Delegates to the corresponding type-specific method.
|
boolean |
remove(Object ok)
Delegates to the type-specific
rem() method. |
boolean |
removeAll(CharCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
removeAll(Collection<?> c)
Remove from this collection all elements in the given collection.
|
boolean |
retainAll(CharCollection c)
Retains in this collection only elements from the given type-specific collection.
|
boolean |
retainAll(Collection<?> c)
Retains in this collection only elements from the given collection.
|
Object[] |
toArray() |
char[] |
toArray(char[] a)
Returns a primitive type array containing the items of this collection.
|
<T> T[] |
toArray(T[] a)
Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.
|
char[] |
toCharArray()
Returns a primitive type array containing the items of this collection.
|
char[] |
toCharArray(char[] a)
Returns a primitive type array containing the items of this collection.
|
String |
toString() |
clear, sizeequals, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, equals, hashCode, parallelStream, removeIf, size, spliterator, streampublic char[] toArray(char[] a)
CharCollectionNote that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.
toArray in interface CharCollectiona - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])public char[] toCharArray()
CharCollectiontoCharArray in interface CharCollectionCollection.toArray()public char[] toCharArray(char[] a)
CharCollectionNote that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.
toCharArray in interface CharCollectiona - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])public boolean addAll(CharCollection c)
addAll in interface CharCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean containsAll(CharCollection c)
containsAll in interface CharCollectionc - a type-specific collection.true if this collection contains all elements of the argument.Collection.containsAll(Collection)public boolean retainAll(CharCollection c)
retainAll in interface CharCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.retainAll(Collection)public boolean removeAll(CharCollection c)
removeAll in interface CharCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.removeAll(Collection)public Object[] toArray()
toArray in interface Collection<Character>toArray in class AbstractCollection<Character>public <T> T[] toArray(T[] a)
CharCollectionWarning: Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the
last one.
toArray in interface CharCollectiontoArray in interface Collection<Character>toArray in class AbstractCollection<Character>a - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])public boolean addAll(Collection<? extends Character> c)
addAll in interface Collection<Character>addAll in class AbstractCollection<Character>c - a collection.true if this collection changed as a result of the call.public boolean add(char k)
add in interface CharCollectionCollection.add(Object)@Deprecated public CharIterator charIterator()
charIterator in interface CharCollectionCharCollection.iterator()public abstract CharIterator 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 Iterable<Character>iterator in interface Collection<Character>iterator in class AbstractCollection<Character>public boolean remove(Object ok)
rem() method.remove in interface Collection<Character>remove in class AbstractCollection<Character>public boolean add(Character o)
add in interface Collection<Character>add in class AbstractCollection<Character>public boolean rem(Object o)
public boolean contains(Object o)
contains in interface Collection<Character>contains in class AbstractCollection<Character>public boolean contains(char k)
contains in interface CharCollectionCollection.contains(Object)public boolean rem(char k)
CharCollectionremove(), 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 CharCollectionCollection.remove(Object)public boolean containsAll(Collection<?> c)
containsAll in interface Collection<Character>containsAll in class AbstractCollection<Character>c - a collection.true if this collection contains all elements of the argument.public boolean retainAll(Collection<?> c)
retainAll in interface Collection<Character>retainAll in class AbstractCollection<Character>c - a collection.true if this collection changed as a result of the call.public boolean removeAll(Collection<?> c)
removeAll in interface Collection<Character>removeAll in class AbstractCollection<Character>c - a collection.true if this collection changed as a result of the call.public boolean isEmpty()
isEmpty in interface Collection<Character>isEmpty in class AbstractCollection<Character>public String toString()
toString in class AbstractCollection<Character>