public static class ObjectCollections.SynchronizedCollection<K> extends java.lang.Object implements ObjectCollection<K>, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(K k) |
boolean |
addAll(java.util.Collection<? extends K> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
isEmpty() |
ObjectIterator<K> |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
ObjectIterator<K> |
objectIterator()
Deprecated.
|
boolean |
rem(java.lang.Object k) |
boolean |
remove(java.lang.Object ok) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<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.
|
java.lang.String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public int size()
size
in interface java.util.Collection<K>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<K>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<K>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<K>
public <T> T[] toArray(T[] a)
ObjectCollection
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 ObjectCollection<K>
toArray
in interface java.util.Collection<K>
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public ObjectIterator<K> iterator()
ObjectCollection
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 ObjectCollection<K>
iterator
in interface ObjectIterable<K>
iterator
in interface java.lang.Iterable<K>
iterator
in interface java.util.Collection<K>
@Deprecated public ObjectIterator<K> objectIterator()
ObjectCollection
objectIterator
in interface ObjectCollection<K>
ObjectCollection.iterator()
public boolean rem(java.lang.Object k)
public boolean remove(java.lang.Object ok)
remove
in interface java.util.Collection<K>
public boolean addAll(java.util.Collection<? extends K> c)
addAll
in interface java.util.Collection<K>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<K>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<K>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<K>
public void clear()
clear
in interface java.util.Collection<K>
public java.lang.String toString()
toString
in class java.lang.Object