@Generated(date="2017-07-11T19:16:21+0200",
value="AbstractKTypeCollection.java")
public abstract class AbstractObjectCollection<KType>
extends java.lang.Object
implements ObjectCollection<KType>
| Modifier and Type | Field and Description |
|---|---|
protected ObjectPredicate<KType> |
containsNegateTestPredicate |
protected ObjectPredicate<KType> |
containsTestPredicate |
protected ObjectPredicate<KType> |
negatePredicate |
protected ObjectLookupContainer<? super KType> |
testContainer |
protected ObjectPredicate<? super KType> |
testPredicate |
| Constructor and Description |
|---|
AbstractObjectCollection() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEmpty()
True if there is no elements in the container,
equivalent to
size() == 0 |
int |
removeAll(ObjectLookupContainer<? super KType> c)
Default implementation uses a predicate for removal.
|
int |
retainAll(ObjectLookupContainer<? super KType> c)
Keeps all elements in this collection that are present
in
c. |
int |
retainAll(ObjectPredicate<? super KType> predicate)
Keeps all elements in this collection for which the
given predicate returns
true. |
java.lang.Object[] |
toArray()
Copies all elements from this container to an array.
|
<T> T[] |
toArray(java.lang.Class<T> componentClass)
Default implementation for:
Copies all elements of this container to a dynamically created array of the given
component type.
|
KType[] |
toArray(KType[] target)
Default implementation for:
Copies all elements of this container to an existing array of the same type.
|
java.lang.String |
toString()
Convert the contents of this container to a human-friendly string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, removeAll, removeAllprotected ObjectLookupContainer<? super KType> testContainer
protected ObjectPredicate<? super KType> testPredicate
protected ObjectPredicate<KType> containsTestPredicate
protected ObjectPredicate<KType> containsNegateTestPredicate
protected ObjectPredicate<KType> negatePredicate
public int removeAll(ObjectLookupContainer<? super KType> c)
removeAll in interface ObjectCollection<KType>public int retainAll(ObjectLookupContainer<? super KType> c)
c. Runs in time proportional to the number
of elements in this collection. Equivalent of sets intersection.retainAll in interface ObjectCollection<KType>public int retainAll(ObjectPredicate<? super KType> predicate)
true.retainAll in interface ObjectCollection<KType>public <T> T[] toArray(java.lang.Class<T> componentClass)
ArrayStoreException may be thrown if this container's elements
are not assignable to the array's component type.
The returned array is always a copy, regardless of the storage used by the container.toArray in interface ObjectContainer<KType>public KType[] toArray(KType[] target)
toArray in interface ObjectContainer<KType>target - The target array must be large enough to hold all elements, i.e >= ObjectContainer.size().public java.lang.Object[] toArray()
The returned array is sized to match exactly the number of elements of the container.
If you need an array of the type identical with this container's generic type, useObjectContainer.toArray(Class).toArray in interface ObjectContainer<KType>ObjectContainer.toArray(Class)public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isEmpty()
ObjectContainersize() == 0isEmpty in interface ObjectContainer<KType>Copyright © 2017. All rights reserved.