public static class ObjectCollections.SynchronizedCollection<K> extends Object implements ObjectCollection<K>, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected ObjectCollection<K> |
collection |
protected Object |
sync |
| Modifier | Constructor and Description |
|---|---|
protected |
SynchronizedCollection(ObjectCollection<K> c) |
protected |
SynchronizedCollection(ObjectCollection<K> c,
Object sync) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(K k) |
boolean |
addAll(Collection<? extends K> c) |
void |
clear() |
boolean |
contains(Object k) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty() |
ObjectIterator<K> |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(Object k) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitparallelStream, removeIf, spliterator, streamprotected final ObjectCollection<K> collection
protected final Object sync
protected SynchronizedCollection(ObjectCollection<K> c, Object sync)
protected SynchronizedCollection(ObjectCollection<K> c)
public boolean add(K k)
add in interface Collection<K>public boolean contains(Object k)
contains in interface Collection<K>public boolean remove(Object k)
remove in interface Collection<K>public int size()
size in interface Collection<K>public boolean isEmpty()
isEmpty in interface Collection<K>public Object[] toArray()
toArray in interface Collection<K>public <T> T[] toArray(T[] a)
toArray in interface Collection<K>public ObjectIterator<K> iterator()
ObjectCollectionNote 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 Iterable<K>iterator in interface Collection<K>Iterable.iterator()public boolean addAll(Collection<? extends K> c)
addAll in interface Collection<K>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<K>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<K>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<K>public void clear()
clear in interface Collection<K>public int hashCode()
hashCode in interface Collection<K>hashCode in class ObjectCopyright © 2020. All rights reserved.