org.openrdf.repository.object
Class ObjectQuery

java.lang.Object
  extended by org.openrdf.repository.object.ObjectQuery
All Implemented Interfaces:
Query

public class ObjectQuery
extends Object
implements Query

Extends Query by providing setObject(String, Object) and setType(String, Class) for object binding.

Author:
James Leigh

Field Summary
protected  ObjectConnection manager
           
protected  TupleQuery query
           
 
Constructor Summary
ObjectQuery(ObjectConnection manager, TupleQuery query)
           
 
Method Summary
 Result<?> evaluate()
          Evaluates the query returning a result of Object or result of Object[], if there is more than one binding.
 Result<Object[]> evaluate(Class<?>... concepts)
          Evaluates the query returning a result of Object[].
<T> Result<T>
evaluate(Class<T> concept)
          Evaluates the query returning a result of a single Object, assumed to implement the given concept.
 BindingSet getBindings()
           
 Dataset getDataset()
           
 boolean getIncludeInferred()
           
 int getMaxQueryTime()
           
 void removeBinding(String name)
           
 void setBinding(String name, Value value)
           
 void setDataset(Dataset arg0)
           
 void setIncludeInferred(boolean include)
           
 void setMaxQueryTime(int sec)
           
 void setObject(String name, Object value)
          Binds the specified variable to the supplied object.
 void setType(String name, Class<?> concept)
          Binds the specified variable to the supplied concept.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

manager

protected ObjectConnection manager

query

protected TupleQuery query
Constructor Detail

ObjectQuery

public ObjectQuery(ObjectConnection manager,
                   TupleQuery query)
Method Detail

getBindings

public BindingSet getBindings()
Specified by:
getBindings in interface Query

removeBinding

public void removeBinding(String name)
Specified by:
removeBinding in interface Query

setBinding

public void setBinding(String name,
                       Value value)
Specified by:
setBinding in interface Query

getDataset

public Dataset getDataset()
Specified by:
getDataset in interface Query

setDataset

public void setDataset(Dataset arg0)
Specified by:
setDataset in interface Query

getMaxQueryTime

public int getMaxQueryTime()
Specified by:
getMaxQueryTime in interface Query

setMaxQueryTime

public void setMaxQueryTime(int sec)
Specified by:
setMaxQueryTime in interface Query

getIncludeInferred

public boolean getIncludeInferred()
Specified by:
getIncludeInferred in interface Query

setIncludeInferred

public void setIncludeInferred(boolean include)
Specified by:
setIncludeInferred in interface Query

setObject

public void setObject(String name,
                      Object value)
Binds the specified variable to the supplied object. Any value that was previously bound to the specified value will be overwritten.

Parameters:
name - variable name
value - datatype or concept implementation

setType

public void setType(String name,
                    Class<?> concept)
Binds the specified variable to the supplied concept. Any value that was previously bound to the specified value will be overwritten.

Parameters:
name - variable name
concept - a registered concept class or interface

evaluate

public Result<?> evaluate()
                   throws QueryEvaluationException
Evaluates the query returning a result of Object or result of Object[], if there is more than one binding.

Throws:
QueryEvaluationException

evaluate

public <T> Result<T> evaluate(Class<T> concept)
                   throws QueryEvaluationException
Evaluates the query returning a result of a single Object, assumed to implement the given concept.

Throws:
QueryEvaluationException

evaluate

public Result<Object[]> evaluate(Class<?>... concepts)
                          throws QueryEvaluationException
Evaluates the query returning a result of Object[].

Throws:
QueryEvaluationException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2009 James Leigh Services Inc.. All Rights Reserved.