net.sf.sparql.benchmarking.operations.query.callables
Class AbstractScalarValueCallable<T extends Options,TCallable extends AbstractQueryCallable<T>>
java.lang.Object
net.sf.sparql.benchmarking.operations.AbstractOperationCallable<T>
net.sf.sparql.benchmarking.operations.query.callables.AbstractQueryCallable<T>
net.sf.sparql.benchmarking.operations.query.callables.WrapperQueryCallable<T,TCallable>
net.sf.sparql.benchmarking.operations.query.callables.AbstractScalarValueCallable<T,TCallable>
- Type Parameters:
T
- Options typeTCallable
- Callable type
- All Implemented Interfaces:
- Callable<OperationRun>, OperationCallable<T>
- Direct Known Subclasses:
- LongValueCallable
public abstract class AbstractScalarValueCallable<T extends Options,TCallable extends AbstractQueryCallable<T>>
- extends WrapperQueryCallable<T,TCallable>
A callable which counts SELECT results by retrieving the value of a specific
column of the first row and then converting that value into an integer
- Author:
- rvesse
Method Summary |
protected long |
countResults(T options,
ResultSet rset)
Counts results for queries that return a result set |
protected abstract long |
nodeToLong(Node n)
Method that should be implemented by derived classes to convert the node
into an integer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractScalarValueCallable
public AbstractScalarValueCallable(Runner<T> runner,
T options,
TCallable callable,
String var)
- Creates a new scalar value callable
- Parameters:
runner
- Runneroptions
- Optionscallable
- Callable to decoratevar
- Variable name to take the value from
countResults
protected long countResults(T options,
ResultSet rset)
- Description copied from class:
AbstractQueryCallable
- Counts results for queries that return a result set
The default implementation either returns OperationRun.UNKNOWN
if
the options indicate that counting is disabled or iterates over the
results to count them.
- Overrides:
countResults
in class WrapperQueryCallable<T extends Options,TCallable extends AbstractQueryCallable<T>>
- Parameters:
options
- Optionsrset
- Result Set
- Returns:
- Number of results
nodeToLong
protected abstract long nodeToLong(Node n)
- Method that should be implemented by derived classes to convert the node
into an integer
- Parameters:
n
- Node
- Returns:
- Long integer
Copyright © 2014. All Rights Reserved.