org.openrdf.query.algebra
Interface QueryModelNode

All Superinterfaces:
Cloneable
All Known Subinterfaces:
AggregateOperator, SqlExpr, TupleExpr, ValueExpr
All Known Implementing Classes:
And, BinarySqlOperator, BinaryTupleOperator, BinaryValueOperator, BNodeColumn, BNodeGenerator, BooleanValue, Bound, Compare, CompareAll, CompareAny, CompareSubQueryValueOperator, Count, Datatype, DatatypeColumn, DateTimeColumn, Difference, Distinct, DoubleValue, EmptySet, Exists, Extension, ExtensionElem, FalseValue, Filter, FromItem, FunctionCall, Group, GroupElem, HashColumn, IdColumn, In, Intersection, IsBNode, IsLiteral, IsResource, IsURI, Join, JoinItem, Label, LabelColumn, Lang, LangMatches, LanguageColumn, LeftJoin, Like, LocalName, LongLabelColumn, LongURIColumn, MathExpr, Max, Min, MultiProjection, Namespace, Not, NumberValue, NumericColumn, Or, Order, OrderElem, Projection, ProjectionElem, ProjectionElemList, QueryModelNodeBase, QueryRoot, RdbmsQueryModelNodeBase, RefIdColumn, Regex, SameTerm, SelectProjection, SelectQuery, SingletonSet, Slice, SqlAbs, SqlAnd, SqlCase, SqlCast, SqlCompare, SqlConcat, SqlConstant, SqlEq, SqlIsNull, SqlLike, SqlLowerCase, SqlMathExpr, SqlNot, SqlNull, SqlOr, SqlRegex, SqlShift, StatementPattern, Str, StringValue, SubQueryValueOperator, TrueValue, UnarySqlOperator, UnaryTupleOperator, UnaryValueOperator, Union, UnionItem, URIColumn, ValueColumnBase, ValueConstant, Var

public interface QueryModelNode
extends Cloneable

Main interface for all query model nodes.


Method Summary
 QueryModelNode clone()
          Returns a (deep) clone of this query model node.
 QueryModelNode getParentNode()
          Gets the node's parent.
 String getSignature()
          Returns the signature of this query model node.
 void replaceChildNode(QueryModelNode current, QueryModelNode replacement)
          Replaces one of the child nodes with a new node.
 void replaceWith(QueryModelNode replacement)
          Substitutes this node with a new node in the query model tree.
 void setParentNode(QueryModelNode parent)
          Sets the node's parent.
 String toString()
          Returns an indented print of the node tree, starting from this node.
<X extends Exception>
void
visit(QueryModelVisitor<X> visitor)
          Visits this node.
<X extends Exception>
void
visitChildren(QueryModelVisitor<X> visitor)
          Visits the children of this node.
 

Method Detail

visit

<X extends Exception> void visit(QueryModelVisitor<X> visitor)
           throws X extends Exception
Visits this node. The node reports itself to the visitor with the proper runtime type.

Throws:
X extends Exception

visitChildren

<X extends Exception> void visitChildren(QueryModelVisitor<X> visitor)
                   throws X extends Exception
Visits the children of this node. The node calls visit(QueryModelVisitor) on all of its child nodes.

Throws:
X extends Exception

getParentNode

QueryModelNode getParentNode()
Gets the node's parent.

Returns:
The parent node, if any.

setParentNode

void setParentNode(QueryModelNode parent)
Sets the node's parent.

Parameters:
parent - The parent node for this node.

replaceChildNode

void replaceChildNode(QueryModelNode current,
                      QueryModelNode replacement)
Replaces one of the child nodes with a new node.

Parameters:
current - The current child node.
replacement - The new child node.
Throws:
IllegalArgumentException - If current is not one of node's children.
ClassCastException - If replacement is of an incompatible type.

replaceWith

void replaceWith(QueryModelNode replacement)
Substitutes this node with a new node in the query model tree.

Parameters:
replacement - The new node.
Throws:
IllegalStateException - If this node does not have a parent node.
ClassCastException - If replacement is of an incompatible type.

toString

String toString()
Returns an indented print of the node tree, starting from this node.

Overrides:
toString in class Object

getSignature

String getSignature()
Returns the signature of this query model node. Signatures normally include the node's name and any parameters, but not parent or child nodes. This method is used by toString().

Returns:
The node's signature, e.g. SLICE (offset=10, limit=10).

clone

QueryModelNode clone()
Returns a (deep) clone of this query model node. This method recursively clones the entire node tree, starting from this nodes.

Returns:
A deep clone of this query model node.


Copyright © 2001-2008 Aduna. All Rights Reserved.