Interface ObjectCollection<KType>
- All Superinterfaces:
Iterable<ObjectCursor<KType>>, ObjectContainer<KType>
- All Known Subinterfaces:
ObjectDeque<KType>, ObjectIndexedContainer<KType>, ObjectSet<KType>
- All Known Implementing Classes:
AbstractObjectCollection, ByteObjectHashMap.ValuesContainer, CharObjectHashMap.ValuesContainer, DoubleObjectHashMap.ValuesContainer, FloatObjectHashMap.ValuesContainer, IntObjectHashMap.ValuesContainer, LongObjectHashMap.ValuesContainer, ObjectArrayDeque, ObjectArrayList, ObjectByteHashMap.KeysContainer, ObjectCharHashMap.KeysContainer, ObjectDoubleHashMap.KeysContainer, ObjectFloatHashMap.KeysContainer, ObjectHashSet, ObjectIdentityHashSet, ObjectIntHashMap.KeysContainer, ObjectLongHashMap.KeysContainer, ObjectObjectHashMap.KeysContainer, ObjectObjectHashMap.ValuesContainer, ObjectScatterSet, ObjectShortHashMap.KeysContainer, ObjectStack, ShortObjectHashMap.ValuesContainer
@Generated(date="2024-05-16T08:18:11+0000",
value="KTypeCollection.java")
public interface ObjectCollection<KType>
extends ObjectContainer<KType>
A collection allows basic, efficient operations on sets of elements
(difference and intersection).
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all elements from this collection.voidrelease()Removes all elements from the collection and additionally releases any internal buffers.intremoveAll(ObjectLookupContainer<? super KType> c) Removes all elements in this collection that are present inc.intremoveAll(ObjectPredicate<? super KType> predicate) Removes all elements in this collection for which the given predicate returnstrue.intRemoves all occurrences ofefrom this collection.intretainAll(ObjectLookupContainer<? super KType> c) Keeps all elements in this collection that are present inc.intretainAll(ObjectPredicate<? super KType> predicate) Keeps all elements in this collection for which the given predicate returnstrue.Methods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
removeAll
Removes all occurrences ofefrom this collection.- Parameters:
e- Element to be removed from this collection, if present.- Returns:
- The number of removed elements as a result of this call.
-
removeAll
Removes all elements in this collection that are present inc.- Returns:
- Returns the number of removed elements.
-
removeAll
Removes all elements in this collection for which the given predicate returnstrue.- Returns:
- Returns the number of removed elements.
-
retainAll
Keeps all elements in this collection that are present inc. Runs in time proportional to the number of elements in this collection. Equivalent of sets intersection.- Returns:
- Returns the number of removed elements.
-
retainAll
Keeps all elements in this collection for which the given predicate returnstrue.- Returns:
- Returns the number of removed elements.
-
clear
void clear()Removes all elements from this collection.- See Also:
-
release
void release()Removes all elements from the collection and additionally releases any internal buffers. Typically, if the object is to be reused, a simpleclear()should be a better alternative since it'll avoid reallocation.- See Also:
-