- Type Parameters:
E- the element type of the set
- All Superinterfaces:
Iterable<E>,JenaMapSetCommon<E>,Sized
- All Known Subinterfaces:
FastTripleBunch,JenaSetHashOptimized<E>,JenaSetIndexed<E>,NodeToTriplesMap,TripleBunch
- All Known Implementing Classes:
ArrayBunch,FastArrayBunch,FastHashedTripleBunch,FastHashSet,HashCommonSet,HashedTripleBunch,NodeToTriplesMapMem,TripleSet,TripleSet
Set interface specialized for the use cases in triple-store implementations.
Not thread-safe; does not allow
null elements.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddUnchecked(E key) Add the key to the set without checking whether it is already present.default voiditerator()default Spliterator<E> booleanAdd the key to the set if it is not already present.Methods inherited from interface org.apache.jena.mem.collection.JenaMapSetCommon
anyMatch, clear, containsKey, isEmpty, keyIterator, keySpliterator, keyStream, keyStreamParallel, removeUnchecked, tryRemove
-
Method Details
-
tryAdd
Add the key to the set if it is not already present.- Parameters:
key- the key to add. (nullis not allowed)- Returns:
trueif the key was added,falseif it was already present
-
addUnchecked
Add the key to the set without checking whether it is already present.Attention: this method must only be used if the caller has ensured that the key is not already in the set; otherwise the set's invariants will break (duplicates may be inserted).
- Parameters:
key- the key to add. (nullis not allowed)
-
forEach
-
spliterator
- Specified by:
spliteratorin interfaceIterable<E>
-
iterator
-