Class SolutionMappingsIndexForMixedUsage
java.lang.Object
se.liu.ida.hefquin.base.datastructures.impl.WrappingSolutionMappingsIndex
se.liu.ida.hefquin.base.datastructures.impl.SolutionMappingsIndexForMixedUsage
- All Implemented Interfaces:
Iterable<SolutionMapping>,Collection<SolutionMapping>,SolutionMappingsIndex,StatsProvider
Wraps another
SolutionMappingsIndex and, for every method that
returns an Iterable of solution mappings, this implementation
copies the Iterable returned by the wrapped index into a new
list and, then, returns that list.
This class can be used for cases in which adding and probing into such
an index may happen concurrently. In such cases, there can be conflicts
when the index is updated by one thread while another thread is still
consuming an Iterable returned by one of the methods. Returning
a copy of the Iterable avoids such conflicts.-
Field Summary
Fields inherited from class se.liu.ida.hefquin.base.datastructures.impl.WrappingSolutionMappingsIndex
wrappedIndex -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Iterable<SolutionMapping>findSolutionMappings(org.apache.jena.sparql.core.Var var, org.apache.jena.graph.Node value) Returns an iterator over all solution mappings in this index that map the given variable to the given value.findSolutionMappings(org.apache.jena.sparql.core.Var var1, org.apache.jena.graph.Node value1, org.apache.jena.sparql.core.Var var2, org.apache.jena.graph.Node value2) Returns an iterator over all solution mappings in this index that map the first variable to the first value and the second variable to the second value.findSolutionMappings(org.apache.jena.sparql.core.Var var1, org.apache.jena.graph.Node value1, org.apache.jena.sparql.core.Var var2, org.apache.jena.graph.Node value2, org.apache.jena.sparql.core.Var var3, org.apache.jena.graph.Node value3) This method is a three-variables version of the methodSolutionMappingsIndex.findSolutionMappings(Var, Node).Returns all solution mappings currently in this index.Returns an iterator over all solution mappings in this index that are compatible with the given solution mappings.<T> T[]toArray(T[] a) Methods inherited from class se.liu.ida.hefquin.base.datastructures.impl.WrappingSolutionMappingsIndex
add, addAll, clear, contains, containsAll, getStats, isEmpty, remove, removeAll, resetStats, retainAll, size, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArrayMethods inherited from interface se.liu.ida.hefquin.base.datastructures.SolutionMappingsIndex
iterator
-
Constructor Details
-
SolutionMappingsIndexForMixedUsage
-
-
Method Details
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<SolutionMapping>- Overrides:
toArrayin classWrappingSolutionMappingsIndex
-
getJoinPartners
public Iterable<SolutionMapping> getJoinPartners(SolutionMapping sm) throws UnsupportedOperationException Description copied from interface:SolutionMappingsIndexReturns an iterator over all solution mappings in this index that are compatible with the given solution mappings. Implementations may choose to support this method only for specific types of solution mappings (e.g., with specific variables), in which case anUnsupportedOperationExceptionwill be thrown if the method is called with an unsupported variable.- Specified by:
getJoinPartnersin interfaceSolutionMappingsIndex- Overrides:
getJoinPartnersin classWrappingSolutionMappingsIndex- Throws:
UnsupportedOperationException
-
findSolutionMappings
public Iterable<SolutionMapping> findSolutionMappings(org.apache.jena.sparql.core.Var var, org.apache.jena.graph.Node value) throws UnsupportedOperationException Description copied from interface:SolutionMappingsIndexReturns an iterator over all solution mappings in this index that map the given variable to the given value. Implementations may choose to support this method only for specific variables, in which case anUnsupportedOperationExceptionwill be thrown if the method is called with an unsupported variable. The result of this method should essentially be the same as the result of callingSolutionMappingsIndex.getJoinPartners(SolutionMapping)with a solution mapping that is defined only for the given variable and that maps this variable to the given value.- Specified by:
findSolutionMappingsin interfaceSolutionMappingsIndex- Overrides:
findSolutionMappingsin classWrappingSolutionMappingsIndex- Throws:
UnsupportedOperationException
-
findSolutionMappings
public Iterable<SolutionMapping> findSolutionMappings(org.apache.jena.sparql.core.Var var1, org.apache.jena.graph.Node value1, org.apache.jena.sparql.core.Var var2, org.apache.jena.graph.Node value2) throws UnsupportedOperationException Description copied from interface:SolutionMappingsIndexReturns an iterator over all solution mappings in this index that map the first variable to the first value and the second variable to the second value. Hence, this method is a two-variables version of the methodSolutionMappingsIndex.findSolutionMappings(Var, Node).- Specified by:
findSolutionMappingsin interfaceSolutionMappingsIndex- Overrides:
findSolutionMappingsin classWrappingSolutionMappingsIndex- Throws:
UnsupportedOperationException
-
findSolutionMappings
public Iterable<SolutionMapping> findSolutionMappings(org.apache.jena.sparql.core.Var var1, org.apache.jena.graph.Node value1, org.apache.jena.sparql.core.Var var2, org.apache.jena.graph.Node value2, org.apache.jena.sparql.core.Var var3, org.apache.jena.graph.Node value3) throws UnsupportedOperationException Description copied from interface:SolutionMappingsIndexThis method is a three-variables version of the methodSolutionMappingsIndex.findSolutionMappings(Var, Node).- Specified by:
findSolutionMappingsin interfaceSolutionMappingsIndex- Overrides:
findSolutionMappingsin classWrappingSolutionMappingsIndex- Throws:
UnsupportedOperationException
-
getAllSolutionMappings
Description copied from interface:SolutionMappingsIndexReturns all solution mappings currently in this index.- Specified by:
getAllSolutionMappingsin interfaceSolutionMappingsIndex- Overrides:
getAllSolutionMappingsin classWrappingSolutionMappingsIndex
-
copy
-