com.hp.hpl.jena.sparql.core
Class QuerySolutionBase

java.lang.Object
  extended by com.hp.hpl.jena.sparql.core.QuerySolutionBase
All Implemented Interfaces:
QuerySolution
Direct Known Subclasses:
QuerySolutionMap, ResultBinding

public abstract class QuerySolutionBase
extends Object
implements QuerySolution

Implementation of QuerySolution that contains the canonicalization and casting code.


Constructor Summary
QuerySolutionBase()
           
 
Method Summary
 boolean contains(String varName)
          Return true if the named variable is in this binding
 com.hp.hpl.jena.rdf.model.RDFNode get(String varName)
          Return the value of the named variable in this binding.
 com.hp.hpl.jena.rdf.model.Literal getLiteral(String varName)
          Return the value of the named variable in this binding, casting to a Literal.
 com.hp.hpl.jena.rdf.model.Resource getResource(String varName)
          Return the value of the named variable in this binding, casting to a Resource.
abstract  Iterator<String> varNames()
          Iterate over the variable names (strings) in this QuerySolution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuerySolutionBase

public QuerySolutionBase()
Method Detail

get

public com.hp.hpl.jena.rdf.model.RDFNode get(String varName)
Description copied from interface: QuerySolution
Return the value of the named variable in this binding. A return of null indicates that the variable is not present in this solution.

Specified by:
get in interface QuerySolution
Returns:
RDFNode

getResource

public com.hp.hpl.jena.rdf.model.Resource getResource(String varName)
Description copied from interface: QuerySolution
Return the value of the named variable in this binding, casting to a Resource. A return of null indicates that the variable is not present in this solution. An exception indicates it was present but not a resource.

Specified by:
getResource in interface QuerySolution
Returns:
Resource

getLiteral

public com.hp.hpl.jena.rdf.model.Literal getLiteral(String varName)
Description copied from interface: QuerySolution
Return the value of the named variable in this binding, casting to a Literal. A return of null indicates that the variable is not present in this solution. An exception indicates it was present but not a literal.

Specified by:
getLiteral in interface QuerySolution
Returns:
Resource

contains

public boolean contains(String varName)
Description copied from interface: QuerySolution
Return true if the named variable is in this binding

Specified by:
contains in interface QuerySolution

varNames

public abstract Iterator<String> varNames()
Description copied from interface: QuerySolution
Iterate over the variable names (strings) in this QuerySolution.

Specified by:
varNames in interface QuerySolution
Returns:
Iterator of strings


Licenced under the Apache License, Version 2.0