public abstract class GroupingExpression extends GroupingNode
GroupingOperation
. You may manually construct this expression, or
you may use the GroupingParser
to generate one from a query-string.Modifier | Constructor and Description |
---|---|
protected |
GroupingExpression(String image,
String label,
Integer level) |
Modifier and Type | Method and Description |
---|---|
static String |
asImage(Object obj)
Returns a string representation of an object that can be used in the 'image' constructor argument of
GroupingNode . |
static String |
asString(List<GroupingExpression> lst)
Returns a string description of the given list of expressions.
|
abstract GroupingExpression |
copy()
Returns a deep copy of this
|
int |
getLevel()
Returns the conceptual level of this expression.
|
protected Integer |
getLevelOrNull() |
void |
resolveLevel(int level)
Resolves the conceptual level of this expression.
|
GroupingExpression |
setLabel(String label)
Assigns a label to this grouping expression.
|
void |
visit(ExpressionVisitor visitor)
Recursively calls
ExpressionVisitor.visitExpression(GroupingExpression) for this expression and all of
its argument expressions. |
getImage, getLabel, toString
public abstract GroupingExpression copy()
public void resolveLevel(int level)
level
- The level of the input data.IllegalArgumentException
- Thrown if the level of this expression could not be resolved.IllegalStateException
- Thrown if type failed to accept the number of arguments provided.public int getLevel()
IllegalArgumentException
- thrown if the level of this expression has not been resolved.resolveLevel(int)
protected final Integer getLevelOrNull()
public void visit(ExpressionVisitor visitor)
ExpressionVisitor.visitExpression(GroupingExpression)
for this expression and all of
its argument expressions.visitor
- The visitor to call.public static String asString(List<GroupingExpression> lst)
GroupingNode.toString()
output.lst
- The list of expressions to output.public static String asImage(Object obj)
GroupingNode
. This method ensures that strings are quoted, and that all complex characters are escaped.obj
- The object to output.public GroupingExpression setLabel(String label)
GroupingNode
setLabel
in class GroupingNode
label
- The label to assign to this.Copyright © 2018. All rights reserved.