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,java.io.Serializable
public class SelectNode extends ExpressionNode
Node for OQL like select statements.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intALLThe selection mode for returning a set of elements (default).static intANYThe selection mode for returning the first matching element.static intASCThe ascending order direction.static intDESCThe descending order direction.static intIOTAThe selection mode for returning a single matching element.protected intmodeThe selection mode.protected intorderThe order direction.protected booleanorderbyThe flag indicating presence of an order by clause.protected java.lang.String[]varsThe variable names.protected booleanwhereThe flag indicating presence of a where clause.-
Fields inherited from class jadex.javaparser.javaccimpl.ExpressionNode
constant, constant_value, expressiontext, imports, static_type, text
-
Fields inherited from class jadex.javaparser.javaccimpl.SimpleNode
children, id, parent
-
-
Constructor Summary
Constructors Constructor Description SelectNode(jadex.javaparser.javaccimpl.ParserImpl p, int id)Create a node.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Test if two nodes are equal.static intfromString(java.lang.String mode)Convert a selection mode from a string representation.ParameterNode[]getUnboundParameterNodes()Get unbound parameter nodes.java.lang.ObjectgetValue(IValueFetcher fetcher)Evaluate the expression in the given state with respect to given parameters.inthashCode()Get the hash code for the node.static intorderFromString(java.lang.String order)Convert an ordering direction from a string representation.static java.lang.StringorderToString(int order)Convert an ordering direction to a string representation.voidprecompile()Precompile the node.voidsetOrder(java.lang.String order)Set the ordering direction.voidsetOrderBy(boolean orderby)Set the where order by flag.voidsetText(java.lang.String text)Set the token text.voidsetVariables(java.lang.String[] vars)Set the variable names.voidsetWhere(boolean where)Set the where clause flag.java.lang.StringtoPlainString()Create a string representation of this node and its subnodes.static java.lang.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, toString
-
Methods inherited from class jadex.javaparser.javaccimpl.SimpleNode
dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
-
-
-
-
Field Detail
-
ALL
public static final int ALL
The selection mode for returning a set of elements (default).- See Also:
- Constant Field Values
-
ANY
public static final int ANY
The selection mode for returning the first matching element.- See Also:
- Constant Field Values
-
IOTA
public static final int IOTA
The selection mode for returning a single matching element.- See Also:
- Constant Field Values
-
ASC
public static final int ASC
The ascending order direction.- See Also:
- Constant Field Values
-
DESC
public static final int DESC
The descending order direction.- See Also:
- Constant Field Values
-
mode
protected int mode
The selection mode.
-
vars
protected java.lang.String[] vars
The variable names.
-
where
protected boolean where
The flag indicating presence of a where clause.
-
orderby
protected boolean orderby
The flag indicating presence of an order by clause.
-
order
protected int order
The order direction.
-
-
Method Detail
-
setText
public void setText(java.lang.String text)
Set the token text.- Overrides:
setTextin classExpressionNode- Parameters:
text- The token text.
-
setVariables
public void setVariables(java.lang.String[] vars)
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
public void setOrder(java.lang.String order)
Set the ordering direction.
-
precompile
public void precompile()
Precompile the node.- Overrides:
precompilein classExpressionNode
-
getValue
public java.lang.Object getValue(IValueFetcher fetcher)
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
public java.lang.String 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
public ParameterNode[] getUnboundParameterNodes()
Get unbound parameter nodes.- Overrides:
getUnboundParameterNodesin classExpressionNode- Returns:
- The unbound parameter nodes.
-
toString
public static java.lang.String toString(int mode)
Convert a selection mode to a string representation.- Parameters:
mode- The mode- Returns:
- A string representation of the mode.
-
orderToString
public static java.lang.String orderToString(int order)
Convert an ordering direction to a string representation.- Parameters:
order- The ordering direction- Returns:
- A string representation of the ordering direction.
-
fromString
public static int fromString(java.lang.String mode)
Convert a selection mode from a string representation.- Parameters:
mode- The mode as string.- Returns:
- The int value of the mode.
-
orderFromString
public static int orderFromString(java.lang.String order)
Convert an ordering direction from a string representation.- Parameters:
order- The ordering direction as string.- Returns:
- The int value of the ordering direction.
-
equals
public boolean equals(java.lang.Object o)
Test if two nodes are equal.- Overrides:
equalsin classExpressionNode
-
hashCode
public int hashCode()
Get the hash code for the node.- Overrides:
hashCodein classExpressionNode
-
-