Class DefaultCollectionFactory
- java.lang.Object
-
- org.eclipse.rdf4j.collection.factory.impl.DefaultCollectionFactory
-
- All Implemented Interfaces:
AutoCloseable,CollectionFactory
public class DefaultCollectionFactory extends Object implements CollectionFactory
A DefaultCollectionFactory that provides lists/sets/maps using standard common java in memory types
-
-
Constructor Summary
Constructors Constructor Description DefaultCollectionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()BindingSetKeycreateBindingSetKey(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(Supplier<MutableBindingSet> create, Function<String,Predicate<BindingSet>> getHas, Function<String,Function<BindingSet,Value>> getget, Function<String,BiConsumer<Value,MutableBindingSet>> getSet)Allows optimizations beyond what would otherwise be possible, regarding disk access and storage.<V> Map<Value,V>createValueKeyedMap()List<Value>createValueList()Queue<Value>createValueQueue()Set<Value>createValueSet()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.collection.factory.api.CollectionFactory
createBindingSetQueue, createBindingSetQueue, createSetOfBindingSets, hashAValue, hashOfBindingSetFuntion
-
-
-
-
Method Detail
-
createList
public <T> List<T> createList()
- Specified by:
createListin interfaceCollectionFactory- Type Parameters:
T- of the list- Returns:
- a list that may be optimised and/or disk based
-
createValueList
public List<Value> createValueList()
- Specified by:
createValueListin interfaceCollectionFactory- Returns:
- a list that may be optimised and/or disk based for Values only
-
createSet
public <T> Set<T> createSet()
- Specified by:
createSetin interfaceCollectionFactory- Type Parameters:
T- of the set- Returns:
- a set that may be optimised and/or disk based
-
createValueSet
public Set<Value> createValueSet()
- Specified by:
createValueSetin interfaceCollectionFactory- Returns:
- a set that may be optimised and/or disk based for Values
-
createSetOfBindingSets
public Set<BindingSet> createSetOfBindingSets(Supplier<MutableBindingSet> create, Function<String,Predicate<BindingSet>> getHas, Function<String,Function<BindingSet,Value>> getget, Function<String,BiConsumer<Value,MutableBindingSet>> getSet)
Description copied from interface:CollectionFactoryAllows optimizations beyond what would otherwise be possible, regarding disk access and storage.- Specified by:
createSetOfBindingSetsin interfaceCollectionFactory- Parameters:
create- a supplier that makes bindingsets- Returns:
- a set that may be optimised and/or disk based
-
createMap
public <K,V> Map<K,V> createMap()
- Specified by:
createMapin interfaceCollectionFactory- Type Parameters:
K- key typeV- value type- Returns:
- a map
-
createValueKeyedMap
public <V> Map<Value,V> createValueKeyedMap()
- Specified by:
createValueKeyedMapin interfaceCollectionFactory- Type Parameters:
V- value type- Returns:
- a map
-
createQueue
public <T> Queue<T> createQueue()
- Specified by:
createQueuein interfaceCollectionFactory- Type Parameters:
T- of the contents of the queue- Returns:
- a new queue
-
createValueQueue
public Queue<Value> createValueQueue()
- Specified by:
createValueQueuein interfaceCollectionFactory- Returns:
- a new queue
-
close
public void close() throws RDF4JException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCollectionFactory- Throws:
RDF4JException
-
createGroupByMap
public <E> Map<BindingSetKey,E> createGroupByMap()
- Specified by:
createGroupByMapin interfaceCollectionFactory
-
createBindingSetKey
public BindingSetKey createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet,Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator)
- Specified by:
createBindingSetKeyin interfaceCollectionFactory
-
-