org.openanzo.glitter.syntax.abstrakt
Class Union

java.lang.Object
  extended by org.openanzo.glitter.syntax.abstrakt.TreeNode
      extended by org.openanzo.glitter.syntax.abstrakt.GraphPattern
          extended by org.openanzo.glitter.syntax.abstrakt.Union

public class Union
extends GraphPattern

Represents a UNION construct from a SPARQL query. The algebra of the SPARQL specification dictates binary unions, but Glitter allows for the possibility of n-ary unions.

Author:
lee

Constructor Summary
Union()
          Default constructor.
Union(GraphPattern p1, GraphPattern p2)
          Construct a union from two operand graph patterns.
 
Method Summary
 void addChild(TreeNode child)
          Adds the given child at the end of this node's children.
 void addGraphPattern(GraphPattern gp)
          Add the given graph pattern to this Union.
 java.util.Iterator<GraphPattern> getChildren()
           
 java.util.ArrayList<GraphPattern> getGraphPatterns()
           
 boolean removeChild(TreeNode child)
          Removes the given child from the collection of children
 boolean replaceChild(TreeNode oldChild, TreeNode newChild)
          Changes the tree below this node by replacing oldChild with newChild
 java.lang.String toString()
           
 
Methods inherited from class org.openanzo.glitter.syntax.abstrakt.TreeNode
containsVariable, getBindableVariableCount, getBindableVariableSet, getFilters, getInScopeFilterSet, getParent, getRoot, getVariableCount, getVariableSet, invalidateCache, invalidateCache, mightBindVariable, prettyPrint, prettyPrint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Union

public Union(GraphPattern p1,
             GraphPattern p2)
Construct a union from two operand graph patterns.

Parameters:
p1 -
p2 -

Union

public Union()
Default constructor. (Contains no operands.)

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addGraphPattern

public void addGraphPattern(GraphPattern gp)
Add the given graph pattern to this Union.

Parameters:
gp -

getGraphPatterns

public java.util.ArrayList<GraphPattern> getGraphPatterns()
Returns:
A list of GraphPattern that are the operands to this Union.

getChildren

public java.util.Iterator<GraphPattern> getChildren()
Specified by:
getChildren in class TreeNode
Returns:
An Iterator over the children of this node.

replaceChild

public boolean replaceChild(TreeNode oldChild,
                            TreeNode newChild)
Description copied from class: TreeNode
Changes the tree below this node by replacing oldChild with newChild

Specified by:
replaceChild in class TreeNode
Returns:
true if the oldChild was found and replaced; false otherwise.

removeChild

public boolean removeChild(TreeNode child)
Description copied from class: TreeNode
Removes the given child from the collection of children

Specified by:
removeChild in class TreeNode
Returns:
true if the child was found and removed; false otherwise.

addChild

public void addChild(TreeNode child)
Description copied from class: TreeNode
Adds the given child at the end of this node's children.

Specified by:
addChild in class TreeNode


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.