Package jadex.javaparser.javaccimpl
Class SelectNode
java.lang.Object
jadex.javaparser.javaccimpl.SimpleNode
jadex.javaparser.javaccimpl.ExpressionNode
jadex.javaparser.javaccimpl.SelectNode
- All Implemented Interfaces:
IParsedExpression,Node,Serializable
Node for OQL like select statements.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe selection mode for returning a set of elements (default).static final intThe selection mode for returning the first matching element.static final intThe ascending order direction.static final intThe descending order direction.static final intThe selection mode for returning a single matching element.protected intThe selection mode.protected intThe order direction.protected booleanThe flag indicating presence of an order by clause.protected String[]The variable names.protected booleanThe flag indicating presence of a where clause.Fields inherited from class jadex.javaparser.javaccimpl.ExpressionNode
constant, constant_value, expressiontext, imports, static_type, textFields inherited from class jadex.javaparser.javaccimpl.SimpleNode
children, id, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if two nodes are equal.static intfromString(String mode) Convert a selection mode from a string representation.Get unbound parameter nodes.getValue(jadex.common.IValueFetcher fetcher) Evaluate the expression in the given state with respect to given parameters.inthashCode()Get the hash code for the node.static intorderFromString(String order) Convert an ordering direction from a string representation.static StringorderToString(int order) Convert an ordering direction to a string representation.voidPrecompile the node.voidSet the ordering direction.voidsetOrderBy(boolean orderby) Set the where order by flag.voidSet the token text.voidsetVariables(String[] vars) Set the variable names.voidsetWhere(boolean where) Set the where clause flag.Create a string representation of this node and its subnodes.static StringtoString(int mode) Convert a selection mode to a string representation.Methods inherited from class jadex.javaparser.javaccimpl.ExpressionNode
appendText, getConstantValue, getExpressionText, getParameters, getStaticType, getText, isConstant, precompileTree, setConstant, setConstantValue, setExpressionText, setStaticType, subnodeToString, throwEvaluationException, throwParseException, toString, toStringMethods inherited from class jadex.javaparser.javaccimpl.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
-
Field Details
-
ALL
public static final int ALLThe selection mode for returning a set of elements (default).- See Also:
-
ANY
public static final int ANYThe selection mode for returning the first matching element.- See Also:
-
IOTA
public static final int IOTAThe selection mode for returning a single matching element.- See Also:
-
ASC
public static final int ASCThe ascending order direction.- See Also:
-
DESC
public static final int DESCThe descending order direction.- See Also:
-
mode
protected int modeThe selection mode. -
vars
The variable names. -
where
protected boolean whereThe flag indicating presence of a where clause. -
orderby
protected boolean orderbyThe flag indicating presence of an order by clause. -
order
protected int orderThe order direction.
-
-
Constructor Details
-
SelectNode
public SelectNode(jadex.javaparser.javaccimpl.ParserImpl p, int id) Create a node.- Parameters:
p- The parser.id- The id.
-
-
Method Details
-
setText
Set the token text.- Overrides:
setTextin classExpressionNode- Parameters:
text- The token text.
-
setVariables
Set the variable names. -
setWhere
public void setWhere(boolean where) Set the where clause flag. -
setOrderBy
public void setOrderBy(boolean orderby) Set the where order by flag. -
setOrder
Set the ordering direction. -
precompile
public void precompile()Precompile the node.- Overrides:
precompilein classExpressionNode
-
getValue
Evaluate the expression in the given state with respect to given parameters.- Specified by:
getValuein interfaceIParsedExpression- Specified by:
getValuein classExpressionNode- Parameters:
params- The parameters (string, value pairs), if any.- Returns:
- The value of the term.
-
toPlainString
Create a string representation of this node and its subnodes.- Specified by:
toPlainStringin interfaceNode- Overrides:
toPlainStringin classExpressionNode- Returns:
- A string representation of this node.
-
getUnboundParameterNodes
Get unbound parameter nodes.- Overrides:
getUnboundParameterNodesin classExpressionNode- Returns:
- The unbound parameter nodes.
-
toString
Convert a selection mode to a string representation.- Parameters:
mode- The mode- Returns:
- A string representation of the mode.
-
orderToString
Convert an ordering direction to a string representation.- Parameters:
order- The ordering direction- Returns:
- A string representation of the ordering direction.
-
fromString
Convert a selection mode from a string representation.- Parameters:
mode- The mode as string.- Returns:
- The int value of the mode.
-
orderFromString
Convert an ordering direction from a string representation.- Parameters:
order- The ordering direction as string.- Returns:
- The int value of the ordering direction.
-
equals
Test if two nodes are equal.- Overrides:
equalsin classExpressionNode
-
hashCode
public int hashCode()Get the hash code for the node.- Overrides:
hashCodein classExpressionNode
-