Interface CollectionFactory
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DefaultCollectionFactory
,MapDbCollectionFactory
@InternalUseOnly public interface CollectionFactory extends AutoCloseable
A Factory that may generate optimised and/or disk based collections Factories like this should not be cached but created a new everytime as the closing is important if they are disk based.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
BindingSetKey
createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet,Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator)
<E> Map<BindingSetKey,E>
createGroupByMap()
<T> List<T>
createList()
<K,V>
Map<K,V>createMap()
<T> Queue<T>
createQueue()
<T> Set<T>
createSet()
Set<BindingSet>
createSetOfBindingSets()
<V> Map<Value,V>
createValueKeyedMap()
List<Value>
createValueList()
Queue<Value>
createValueQueue()
Set<Value>
createValueSet()
default int
hashAValue(Function<BindingSet,Value> getValue, int nextHash, BindingSet bs)
Hashes a value that complies with the hashCode/equals conception but only in context of this collection/factory storage layer.default ToIntFunction<BindingSet>
hashOfBindingSetFuntion(List<Function<BindingSet,Value>> getValues)
Generate a method that calculates a hash code that is valid in context of a single store implementation and QueryExecutionContext.
-
-
-
Method Detail
-
close
void close() throws RDF4JException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
RDF4JException
-
createList
<T> List<T> createList()
- Type Parameters:
T
- of the list- Returns:
- a list that may be optimised and/or disk based
-
createValueList
List<Value> createValueList()
- Returns:
- a list that may be optimised and/or disk based for Values only
-
createSet
<T> Set<T> createSet()
- Type Parameters:
T
- of the set- Returns:
- a set that may be optimised and/or disk based
-
createSetOfBindingSets
Set<BindingSet> createSetOfBindingSets()
- Returns:
- a set that may be optimised and/or disk based
-
createValueSet
Set<Value> createValueSet()
- Returns:
- a set that may be optimised and/or disk based for Values
-
createMap
<K,V> Map<K,V> createMap()
- Type Parameters:
K
- key typeV
- value type- Returns:
- a map
-
createValueKeyedMap
<V> Map<Value,V> createValueKeyedMap()
- Type Parameters:
V
- value type- Returns:
- a map
-
createQueue
<T> Queue<T> createQueue()
- Type Parameters:
T
- of the contents of the queue- Returns:
- a new queue
-
createGroupByMap
@InternalUseOnly <E> Map<BindingSetKey,E> createGroupByMap()
-
createBindingSetKey
@InternalUseOnly BindingSetKey createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet,Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator)
-
hashAValue
@InternalUseOnly default int hashAValue(Function<BindingSet,Value> getValue, int nextHash, BindingSet bs)
Hashes a value that complies with the hashCode/equals conception but only in context of this collection/factory storage layer. Potentially also only valid during a single transaction scope.- Parameters:
getValue
- the function to extract the value to hashnextHash
- any previously calculated hash value for earlier values in the BindingSetbs
- the bindingset to take the value from- Returns:
- a hash function
-
hashOfBindingSetFuntion
@InternalUseOnly default ToIntFunction<BindingSet> hashOfBindingSetFuntion(List<Function<BindingSet,Value>> getValues)
Generate a method that calculates a hash code that is valid in context of a single store implementation and QueryExecutionContext.- Parameters:
getValues
- that should be considered in the hash- Returns:
- a hash function
-
-