public static class CharCollections.SynchronizedCollection extends Object implements CharCollection, Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(char k) |
boolean |
add(Character k) |
boolean |
addAll(CharCollection c) |
boolean |
addAll(Collection<? extends Character> c) |
CharIterator |
charIterator()
Deprecated.
|
void |
clear() |
boolean |
contains(char o) |
boolean |
contains(Object k) |
boolean |
containsAll(CharCollection c) |
boolean |
containsAll(Collection<?> c) |
boolean |
isEmpty() |
CharIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
rem(char k)
|
boolean |
remove(Object ok) |
boolean |
removeAll(CharCollection c) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(CharCollection c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
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() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public int size()
size
in interface Collection<Character>
public boolean isEmpty()
isEmpty
in interface Collection<Character>
public boolean contains(char o)
contains
in interface CharCollection
Collection.contains(Object)
public char[] toCharArray()
CharCollection
toCharArray
in interface CharCollection
Collection.toArray()
public Object[] toArray()
toArray
in interface Collection<Character>
public char[] toCharArray(char[] a)
CharCollection
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.
toCharArray
in interface CharCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public char[] toArray(char[] a)
CharCollection
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 CharCollection
a
- 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 CharCollection
Collection.addAll(Collection)
public boolean containsAll(CharCollection c)
containsAll
in interface CharCollection
Collection.containsAll(Collection)
public boolean removeAll(CharCollection c)
removeAll
in interface CharCollection
Collection.removeAll(Collection)
public boolean retainAll(CharCollection c)
retainAll
in interface CharCollection
Collection.retainAll(Collection)
public boolean add(Character k)
add
in interface Collection<Character>
public boolean contains(Object k)
contains
in interface Collection<Character>
public <T> T[] toArray(T[] a)
CharCollection
Warning: 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 CharCollection
toArray
in interface Collection<Character>
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public CharIterator iterator()
CharCollection
Note 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 CharCollection
iterator
in interface CharIterable
iterator
in interface Iterable<Character>
iterator
in interface Collection<Character>
@Deprecated public CharIterator charIterator()
CharCollection
charIterator
in interface CharCollection
CharCollection.iterator()
public boolean add(char k)
add
in interface CharCollection
Collection.add(Object)
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
Collection.remove(Object)
public boolean remove(Object ok)
remove
in interface Collection<Character>
public boolean addAll(Collection<? extends Character> c)
addAll
in interface Collection<Character>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<Character>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<Character>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<Character>
public void clear()
clear
in interface Collection<Character>