com.carrotsearch.hppc
Interface KTypeCollection<KType>

All Superinterfaces:
java.lang.Iterable<KTypeCursor<KType>>, KTypeContainer<KType>
All Known Subinterfaces:
KTypeDeque<KType>, KTypeIndexedContainer<KType>, KTypeSet<KType>
All Known Implementing Classes:
KTypeArrayDeque, KTypeArrayList, KTypeOpenHashSet, KTypeStack, KTypeVTypeOpenHashMap.KeysContainer

public interface KTypeCollection<KType>
extends KTypeContainer<KType>

A collection allows basic, efficient operations on sets of elements (difference and intersection).


Method Summary
 void clear()
          Removes all elements from this collection.
 int removeAll(KTypeLookupContainer<? extends KType> c)
          Removes all elements in this collection that are present in c.
 int removeAll(KTypePredicate<? super KType> predicate)
          Removes all elements in this collection for which the given predicate returns true.
 int removeAllOccurrences(KType e)
          Removes all occurrences of e from this collection.
 int retainAll(KTypeLookupContainer<? extends KType> c)
          Keeps all elements in this collection that are present in c.
 int retainAll(KTypePredicate<? super KType> predicate)
          Keeps all elements in this collection for which the given predicate returns true.
 
Methods inherited from interface com.carrotsearch.hppc.KTypeContainer
contains, forEach, forEach, isEmpty, iterator, size, toArray, toArray
 

Method Detail

removeAllOccurrences

int removeAllOccurrences(KType e)
Removes all occurrences of e from 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

int removeAll(KTypeLookupContainer<? extends KType> c)
Removes all elements in this collection that are present in c. Runs in time proportional to the number of elements in this collection. Equivalent of sets difference.

Returns:
Returns the number of removed elements.

removeAll

int removeAll(KTypePredicate<? super KType> predicate)
Removes all elements in this collection for which the given predicate returns true.


retainAll

int retainAll(KTypeLookupContainer<? extends KType> c)
Keeps all elements in this collection that are present in c. Runs in time proportional to the number of elements in this collection. Equivalent of sets intersection.

Returns:
Returns the number of removed elements.

retainAll

int retainAll(KTypePredicate<? super KType> predicate)
Keeps all elements in this collection for which the given predicate returns true.


clear

void clear()
Removes all elements from this collection.



Copyright © 2011 Carrot Search s.c.. All Rights Reserved.