public abstract class AbstractObjectCollection<K> extends java.util.AbstractCollection<K> implements ObjectCollection<K>
In particular, this class provide iterator()
, add()
, AbstractCollection.remove(Object)
and
AbstractCollection.contains(Object)
methods that just call the type-specific counterpart.
Modifier and Type | Method and Description |
---|---|
boolean |
add(K k) |
boolean |
addAll(java.util.Collection<? extends K> c)
Adds all elements of the given collection to this collection.
|
boolean |
containsAll(java.util.Collection<?> c)
Checks whether this collection contains all elements from the given collection.
|
boolean |
isEmpty() |
abstract ObjectIterator<K> |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
ObjectIterator<K> |
objectIterator()
Deprecated.
|
boolean |
removeAll(java.util.Collection<?> c)
Remove from this collection all elements in the given collection.
|
boolean |
retainAll(java.util.Collection<?> c)
Retains in this collection only elements from the given collection.
|
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 java.lang.Object[] toArray()
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>
toArray
in class java.util.AbstractCollection<K>
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean addAll(java.util.Collection<? extends K> c)
public boolean add(K k)
@Deprecated public ObjectIterator<K> objectIterator()
objectIterator
in interface ObjectCollection<K>
ObjectCollection.iterator()
public abstract 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>
iterator
in class java.util.AbstractCollection<K>
public boolean containsAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public boolean removeAll(java.util.Collection<?> c)
public boolean isEmpty()
public java.lang.String toString()
toString
in class java.util.AbstractCollection<K>