|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.glitter.syntax.abstrakt.TreeNode
public abstract class TreeNode
A TreeNode is the (abstract) base class for all nodes in the abstract syntax of a SPARQL query. TreeNodes also maintain a cache of properties calculated recursively over a node and its descendants.
| Constructor Summary | |
|---|---|
TreeNode()
|
|
| Method Summary | |
|---|---|
abstract void |
addChild(TreeNode child)
Adds the given child at the end of this node's children. |
boolean |
containsVariable(Variable v)
|
java.util.Map<Variable,java.lang.Integer> |
getBindableVariableCount()
|
java.util.Set<Variable> |
getBindableVariableSet()
|
abstract java.util.Iterator<? extends TreeNode> |
getChildren()
|
java.util.Set<Expression> |
getFilters()
Default implementation of getFilters(). |
java.util.Set<Expression> |
getInScopeFilterSet()
|
TreeNode |
getParent()
|
TreeNode |
getRoot()
|
java.util.Map<Variable,java.lang.Integer> |
getVariableCount()
|
java.util.Set<Variable> |
getVariableSet()
|
void |
invalidateCache()
Invalidate the entire cache. |
void |
invalidateCache(java.lang.String key)
Clear the cache corresponding to the given key |
boolean |
mightBindVariable(Variable v)
|
void |
prettyPrint(java.lang.StringBuffer output)
Pretty prints this tree node to the given StringBuffer. |
void |
prettyPrint(java.lang.StringBuffer output,
boolean deep)
Pretty prints this tree node to the given StringBuffer. |
abstract boolean |
removeChild(TreeNode child)
Removes the given child from the collection of children |
abstract boolean |
replaceChild(TreeNode oldChild,
TreeNode newChild)
Changes the tree below this node by replacing oldChild with newChild |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TreeNode()
| Method Detail |
|---|
public void invalidateCache(java.lang.String key)
key - public void invalidateCache()
public TreeNode getParent()
TreeNode. If this is the root of a query, returns null.public abstract java.util.Iterator<? extends TreeNode> getChildren()
Iterator over the children of this node.
public abstract boolean replaceChild(TreeNode oldChild,
TreeNode newChild)
oldChild - newChild -
public abstract boolean removeChild(TreeNode child)
child -
public abstract void addChild(TreeNode child)
child - public final boolean containsVariable(Variable v)
v -
Variable v.public final boolean mightBindVariable(Variable v)
v -
Variable v in a position that it could
receive bindings (e.g., a variable in a FILTER cannot receive bindings, but a variable in the GRAPH clause can.public final java.util.Map<Variable,java.lang.Integer> getVariableCount()
public final java.util.Map<Variable,java.lang.Integer> getBindableVariableCount()
Variables that can receive bindings. (As in mightBindVariable(Variable).public final java.util.Set<Variable> getVariableSet()
public final java.util.Set<Variable> getBindableVariableSet()
public final TreeNode getRoot()
TreeNode.public final java.util.Set<Expression> getInScopeFilterSet()
Expressions that are in scope (act on the bindings) for this tree node.public java.util.Set<Expression> getFilters()
getFilters(). Most tree nodes cannot contain filters.
getFilters().public void prettyPrint(java.lang.StringBuffer output)
StringBuffer.
output -
public void prettyPrint(java.lang.StringBuffer output,
boolean deep)
StringBuffer.
output - deep - If true, recurse into descendants. Otherwise, includes an elipsis ("...") for any children.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||