- All Implemented Interfaces:
Iterable<Triple>,org.apache.jena.atlas.lib.Copyable<TripleSet>,JenaMapSetCommon<Triple>,JenaSet<Triple>,JenaSetHashOptimized<Triple>,JenaSetIndexed<Triple>,Sized,IndexedTripleSource
public class TripleSet
extends FastHashSet<Triple>
implements org.apache.jena.atlas.lib.Copyable<TripleSet>, IndexedTripleSource
FastHashSet of Triples used as the canonical triple
collection inside IndexedSetTripleStore. Adds a hook that fires
whenever the underlying keys array grows, so that indexes built on top of
this set (such as the reverse-index arrays in
EagerStoreStrategy)
can resize their parallel data structures in lock-step.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jena.mem.collection.FastHashBase
FastHashBase.KeyAndIndexConsumer<K> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns an independent copy of this set.intReturns the current length of the underlyingkeysarray.Triple[]voidsetOnKeysGrowHook(IntConsumer onKeysGrowHook) Register a callback that is invoked after the keys array grows; the callback receives the new array length.Methods inherited from class org.apache.jena.mem.collection.FastHashSet
addAndGetIndex, addUnchecked, addUnchecked, forEach, tryAdd, tryAddMethods inherited from class org.apache.jena.mem.collection.FastHashBase
anyMatch, anyMatchRandomOrder, clear, containsKey, forEachKey, getKeyAt, indexOf, isEmpty, keyIterator, keySpliterator, removeAndGetIndex, removeUnchecked, removeUnchecked, size, tryRemove, tryRemoveMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.mem.store.indexed.IndexedTripleSource
sizeMethods inherited from interface org.apache.jena.mem.collection.JenaMapSetCommon
anyMatch, clear, containsKey, isEmpty, keyIterator, keySpliterator, keyStream, keyStreamParallel, removeUnchecked, tryRemoveMethods inherited from interface org.apache.jena.mem.collection.JenaSet
iterator, spliteratorMethods inherited from interface org.apache.jena.mem.collection.JenaSetHashOptimized
removeUnchecked, tryRemoveMethods inherited from interface org.apache.jena.mem.collection.JenaSetIndexed
getKeyAt, indexOf, removeAndGetIndex
-
Constructor Details
-
TripleSet
public TripleSet()Creates an empty triple set.
-
-
Method Details
-
setOnKeysGrowHook
Register a callback that is invoked after the keys array grows; the callback receives the new array length. Setting this tonulldisables notifications.- Parameters:
onKeysGrowHook- callback receiving the newkeys.length
-
copy
Returns an independent copy of this set. The grow-hook from the source is not propagated to the copy. -
getInternalKeysLength
public int getInternalKeysLength()Returns the current length of the underlyingkeysarray. This is the upper bound on the indices that may currently be valid; useful for callers that maintain parallel arrays keyed by entry index.- Returns:
- the current capacity of the
keysarray
-
getTriples
- Specified by:
getTriplesin interfaceIndexedTripleSource- Returns:
- the raw triples array
-