- All Superinterfaces:
org.apache.jena.atlas.lib.Copyable<FastTripleBunch>,JenaMapSetCommon<Triple>,JenaSet<Triple>,JenaSetHashOptimized<Triple>
- All Known Implementing Classes:
FastArrayBunch,FastHashedTripleBunch
public interface FastTripleBunch
extends JenaSetHashOptimized<Triple>, org.apache.jena.atlas.lib.Copyable<FastTripleBunch>
A bunch of triples - a stripped-down set with specialized methods. A
bunch is expected to store triples that share some useful property
(such as having the same subject or predicate).
-
Method Summary
Modifier and TypeMethodDescriptionbooleananyMatchRandomOrder(Predicate<Triple> predicate) This method is used to optimize _PO match operations.booleanisArray()Answer true iff this bunch is implemented as an array.Methods inherited from interface org.apache.jena.atlas.lib.Copyable
copyMethods inherited from interface org.apache.jena.mem2.collection.JenaMapSetCommon
anyMatch, clear, containsKey, isEmpty, keyIterator, keySpliterator, keyStream, keyStreamParallel, removeUnchecked, size, tryRemoveMethods inherited from interface org.apache.jena.mem2.collection.JenaSet
addUnchecked, tryAddMethods inherited from interface org.apache.jena.mem2.collection.JenaSetHashOptimized
addUnchecked, removeUnchecked, tryAdd, tryRemove
-
Method Details
-
isArray
boolean isArray()Answer true iff this bunch is implemented as an array. This field is used to optimize some operations by avoiding the need for instanceOf tests.- Returns:
- true iff this bunch is implemented as an arrays
-
anyMatchRandomOrder
This method is used to optimize _PO match operations. TheJenaMapSetCommon.anyMatch(Predicate)method is faster if there are only a few matches. This method is faster if there are many matches and the set is ordered in an unfavorable way. _PO matches usually fall into this category.- Parameters:
predicate- the predicate to match- Returns:
- true if any triple in the bunch matches the predicate
-