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 int
The selection mode for returning a set of elements (default).static final int
The selection mode for returning the first matching element.static final int
The ascending order direction.static final int
The descending order direction.static final int
The selection mode for returning a single matching element.protected int
The selection mode.protected int
The order direction.protected boolean
The flag indicating presence of an order by clause.protected String[]
The variable names.protected boolean
The 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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test if two nodes are equal.static int
fromString
(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.int
hashCode()
Get the hash code for the node.static int
orderFromString
(String order) Convert an ordering direction from a string representation.static String
orderToString
(int order) Convert an ordering direction to a string representation.void
Precompile the node.void
Set the ordering direction.void
setOrderBy
(boolean orderby) Set the where order by flag.void
Set the token text.void
setVariables
(String[] vars) Set the variable names.void
setWhere
(boolean where) Set the where clause flag.Create a string representation of this node and its subnodes.static String
toString
(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 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:
setText
in 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:
precompile
in classExpressionNode
-
getValue
Evaluate the expression in the given state with respect to given parameters.- Specified by:
getValue
in interfaceIParsedExpression
- Specified by:
getValue
in 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:
toPlainString
in interfaceNode
- Overrides:
toPlainString
in classExpressionNode
- Returns:
- A string representation of this node.
-
getUnboundParameterNodes
Get unbound parameter nodes.- Overrides:
getUnboundParameterNodes
in 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:
equals
in classExpressionNode
-
hashCode
public int hashCode()Get the hash code for the node.- Overrides:
hashCode
in classExpressionNode
-