|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.glitter.syntax.abstrakt.TreeNode
org.openanzo.glitter.syntax.abstrakt.GraphPattern
org.openanzo.glitter.syntax.abstrakt.Group
public class Group
A group represents an ordered collection of graph patterns delimited by curly braces in a SPARQL query. A group also contains a set of filters that apply to the bindings generated from the patterns within the group.
| Constructor Summary | |
|---|---|
Group()
Default constructor. |
|
Group(java.util.ArrayList<GraphPattern> patterns)
Construct a group with no filters from a list of graph patterns. |
|
Group(java.util.ArrayList<GraphPattern> patterns,
java.util.HashSet<Expression> filters)
Construct a group from a list of patterns and a set of filter expressions. |
|
Group(GraphPattern[] patterns,
Expression[] filters)
Construct a group from an array of patterns and of filter expressions. |
|
| Method Summary | |
|---|---|
void |
addChild(TreeNode child)
Adds the given child at the end of this node's children. |
void |
addFilter(Expression f)
Add the given filter to this group. |
void |
addGraphPattern(GraphPattern gp)
Adds the given graph pattern to this group. |
void |
addPatternsFrom(Group other)
Add all the graph patterns from another Group to this group. |
Group |
clone()
|
java.util.Iterator<GraphPattern> |
getChildren()
|
java.util.Set<Expression> |
getFilters()
Default implementation of TreeNode.getFilters(). |
java.lang.Iterable<GraphPattern> |
getPatterns()
Get an iterable collection of this group's graph patterns |
void |
makeLastPatternOptional(Group mayMatch)
Converts the last pattern added to this group to be the required portion of an Optional. |
void |
removeAllFilters()
Remove all filters from this group. |
boolean |
removeChild(TreeNode child)
Removes the given child from the collection of children |
boolean |
removeFilter(Expression f)
Remove the given filter from this group. |
boolean |
removeGraphPattern(GraphPattern gp)
Removes the given graph pattern from this group. |
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, 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 |
|---|
public Group()
public Group(GraphPattern[] patterns,
Expression[] filters)
patterns - filters -
public Group(java.util.ArrayList<GraphPattern> patterns,
java.util.HashSet<Expression> filters)
patterns - filters - public Group(java.util.ArrayList<GraphPattern> patterns)
patterns - graph patterns to add to group| Method Detail |
|---|
public Group clone()
clone in class java.lang.Objectpublic boolean removeFilter(Expression f)
f - expression to remove from group
public void removeAllFilters()
public void addFilter(Expression f)
f - expression to add grouppublic java.util.Set<Expression> getFilters()
TreeNodeTreeNode.getFilters(). Most tree nodes cannot contain filters.
getFilters in class TreeNodeTreeNode.getFilters().public boolean removeGraphPattern(GraphPattern gp)
gp - graph pattern to remove from group
public void addGraphPattern(GraphPattern gp)
gp - graph pattern to add to grouppublic void addPatternsFrom(Group other)
Group to this group.
other - source group from which all patterns will be added to this grouppublic java.lang.Iterable<GraphPattern> getPatterns()
public void makeLastPatternOptional(Group mayMatch)
Optional. The new
Optional replaces the last pattern as a child of this group.
mayMatch - The optional part of the new optional.public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Iterator<GraphPattern> getChildren()
getChildren in class TreeNodeIterator over the children of this node.
public boolean replaceChild(TreeNode oldChild,
TreeNode newChild)
TreeNode
replaceChild in class TreeNodepublic boolean removeChild(TreeNode child)
TreeNode
removeChild in class TreeNodepublic void addChild(TreeNode child)
TreeNode
addChild in class TreeNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||