net.sf.sparql.benchmarking.operations.query.callables
Class LongValueCallable<T extends Options,TCallable extends AbstractQueryCallable<T>>

java.lang.Object
  extended by net.sf.sparql.benchmarking.operations.AbstractOperationCallable<T>
      extended by net.sf.sparql.benchmarking.operations.query.callables.AbstractQueryCallable<T>
          extended by net.sf.sparql.benchmarking.operations.query.callables.WrapperQueryCallable<T,TCallable>
              extended by net.sf.sparql.benchmarking.operations.query.callables.AbstractScalarValueCallable<T,TCallable>
                  extended by net.sf.sparql.benchmarking.operations.query.callables.LongValueCallable<T,TCallable>
Type Parameters:
T - Options type
TCallable - Callable type
All Implemented Interfaces:
Callable<OperationRun>, OperationCallable<T>

public class LongValueCallable<T extends Options,TCallable extends AbstractQueryCallable<T>>
extends AbstractScalarValueCallable<T,TCallable>

A callable for getting the value of a specific variable in the first row of a result set as a long

Usually used in conjunction with custom operations like DatasetSizeOperation which calculate some aggregate on the data using a SELECT query and want to return that aggregate value as the number of results rather than the number of results rows as the basic RemoteQueryCallable would return.

Author:
rvesse

Constructor Summary
LongValueCallable(Runner<T> runner, T options, TCallable callable, String var)
          Creates a new callable
 
Method Summary
protected  long nodeToLong(Node n)
          Method that should be implemented by derived classes to convert the node into an integer
 
Methods inherited from class net.sf.sparql.benchmarking.operations.query.callables.AbstractScalarValueCallable
countResults
 
Methods inherited from class net.sf.sparql.benchmarking.operations.query.callables.WrapperQueryCallable
call, countResults, countResults, createQueryExecution, customizeRequest, getQuery
 
Methods inherited from class net.sf.sparql.benchmarking.operations.AbstractOperationCallable
cancel, getOptions, getRunner, isCancelled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongValueCallable

public LongValueCallable(Runner<T> runner,
                         T options,
                         TCallable callable,
                         String var)
Creates a new callable

Parameters:
var - Variable whose value is to be retrieved
runner - Runner
options - Options
callable - Callable to decorate
Method Detail

nodeToLong

protected long nodeToLong(Node n)
Description copied from class: AbstractScalarValueCallable
Method that should be implemented by derived classes to convert the node into an integer

Specified by:
nodeToLong in class AbstractScalarValueCallable<T extends Options,TCallable extends AbstractQueryCallable<T>>
Parameters:
n - Node
Returns:
Long integer


Copyright © 2014. All Rights Reserved.