Class SelectNode

    • 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
      • 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.
    • Constructor Detail

      • SelectNode

        public SelectNode​(jadex.javaparser.javaccimpl.ParserImpl p,
                          int id)
        Create a node.
        Parameters:
        p - The parser.
        id - The id.
    • Method Detail

      • setText

        public void setText​(java.lang.String text)
        Set the token text.
        Overrides:
        setText in class ExpressionNode
        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.
      • getValue

        public java.lang.Object getValue​(IValueFetcher fetcher)
        Evaluate the expression in the given state with respect to given parameters.
        Specified by:
        getValue in interface IParsedExpression
        Specified by:
        getValue in class ExpressionNode
        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 interface Node
        Overrides:
        toPlainString in class ExpressionNode
        Returns:
        A string representation of this node.
      • 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 class ExpressionNode
      • hashCode

        public int hashCode()
        Get the hash code for the node.
        Overrides:
        hashCode in class ExpressionNode