org.nsdl.mptstore.query.component
Class GraphQuery

java.lang.Object
  extended by org.nsdl.mptstore.query.component.GraphQuery
All Implemented Interfaces:
QueryElement

public class GraphQuery
extends java.lang.Object
implements QueryElement

Representation of an RDF graph query.

A GraphQuery contains a sets of required and optional QueryElement components that form a single graph query. Since a GraphQuery is also a QueryElement, graph queries can be arbitrarily nested.

Author:
birkland

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nsdl.mptstore.query.component.QueryElement
QueryElement.Type
 
Constructor Summary
GraphQuery()
           
 
Method Summary
 void addOptional(QueryElement e)
          Add an optional query element.
 void addRequired(QueryElement e)
          Add a required query element.
 java.util.List<QueryElement> getOptional()
          Get the optional query elements.
 java.util.List<QueryElement> getRequired()
          Get the required query elements.
 QueryElement.Type getType()
          Get the type of this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphQuery

public GraphQuery()
Method Detail

getType

public QueryElement.Type getType()
Get the type of this element.

Specified by:
getType in interface QueryElement
Returns:
the type.

addRequired

public void addRequired(QueryElement e)
Add a required query element.

Parameters:
e - the element to add.

addOptional

public void addOptional(QueryElement e)
Add an optional query element.

Parameters:
e - the element to add.

getRequired

public java.util.List<QueryElement> getRequired()
Get the required query elements.

Returns:
the list of required elements.

getOptional

public java.util.List<QueryElement> getOptional()
Get the optional query elements.

Returns:
the list of optional elements.