java.lang.Object
org.apache.jena.mem.collection.HashCommonBase<E>
- Type Parameters:
E- the element type
- All Implemented Interfaces:
JenaMapSetCommon<E>,Sized
- Direct Known Subclasses:
HashCommonMap,HashCommonSet
Common code for hash tables and sets.
The hash table is a lookup table.
The hash codes are not stored. When the table grows, all hash codes need to be recalculated.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck whether the collection contains any element matching the predicate.booleancontainsKey(E key) Check whether the collection contains a given key.booleanisEmpty()Get an iterator over the keys in the collection.Get a spliterator over the keys in the collection.voidremoveUnchecked(E key) Remove the objectkeyfrom this hash's keys if it is present (if it's absent, do nothing).intsize()booleanRemove the objectkeyfrom this hash's keys if it is present (if it's absent, do nothing).Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.mem.collection.JenaMapSetCommon
clear, keyStream, keyStreamParallel
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceJenaMapSetCommon<E>- Returns:
- true if the collection is empty
-
tryRemove
Remove the objectkeyfrom this hash's keys if it is present (if it's absent, do nothing).- Specified by:
tryRemovein interfaceJenaMapSetCommon<E>- Parameters:
key- the key to remove- Returns:
- true if the key was removed. If the key was not present, false is returned.
-
removeUnchecked
Remove the objectkeyfrom this hash's keys if it is present (if it's absent, do nothing).- Specified by:
removeUncheckedin interfaceJenaMapSetCommon<E>- Parameters:
key- the key to remove
-
containsKey
Description copied from interface:JenaMapSetCommonCheck whether the collection contains a given key.- Specified by:
containsKeyin interfaceJenaMapSetCommon<E>- Parameters:
key- the key to look for- Returns:
- true if the collection contains the key
-
anyMatch
Description copied from interface:JenaMapSetCommonCheck whether the collection contains any element matching the predicate.- Specified by:
anyMatchin interfaceJenaMapSetCommon<E>- Parameters:
predicate- the predicate to match- Returns:
- true if the collection contains any element matching the predicate
-
keyIterator
Description copied from interface:JenaMapSetCommonGet an iterator over the keys in the collection.- Specified by:
keyIteratorin interfaceJenaMapSetCommon<E>- Returns:
- an iterator over the keys in the collection
-
keySpliterator
Description copied from interface:JenaMapSetCommonGet a spliterator over the keys in the collection.- Specified by:
keySpliteratorin interfaceJenaMapSetCommon<E>- Returns:
- a spliterator over the keys in the collection
-