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 int
ALL
The selection mode for returning a set of elements (default).static int
ANY
The selection mode for returning the first matching element.static int
ASC
The ascending order direction.static int
DESC
The descending order direction.static int
IOTA
The selection mode for returning a single matching element.protected int
mode
The selection mode.protected int
order
The order direction.protected boolean
orderby
The flag indicating presence of an order by clause.protected java.lang.String[]
vars
The variable names.protected boolean
where
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 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 boolean
equals(java.lang.Object o)
Test if two nodes are equal.static int
fromString(java.lang.String mode)
Convert a selection mode from a string representation.ParameterNode[]
getUnboundParameterNodes()
Get unbound parameter nodes.java.lang.Object
getValue(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(java.lang.String order)
Convert an ordering direction from a string representation.static java.lang.String
orderToString(int order)
Convert an ordering direction to a string representation.void
precompile()
Precompile the node.void
setOrder(java.lang.String order)
Set the ordering direction.void
setOrderBy(boolean orderby)
Set the where order by flag.void
setText(java.lang.String text)
Set the token text.void
setVariables(java.lang.String[] vars)
Set the variable names.void
setWhere(boolean where)
Set the where clause flag.java.lang.String
toPlainString()
Create a string representation of this node and its subnodes.static java.lang.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 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:
setText
in 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:
precompile
in classExpressionNode
-
getValue
public java.lang.Object getValue(IValueFetcher fetcher)
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
public java.lang.String 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
public ParameterNode[] getUnboundParameterNodes()
Get unbound parameter nodes.- Overrides:
getUnboundParameterNodes
in 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:
equals
in classExpressionNode
-
hashCode
public int hashCode()
Get the hash code for the node.- Overrides:
hashCode
in classExpressionNode
-
-