Class SelectHandler

  • All Implemented Interfaces:
    Handler

    public class SelectHandler
    extends java.lang.Object
    implements Handler
    A Select clause handler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAll​(SelectHandler selectHandler)
      Add all the variables from the select handler variable.
      void addVar​(java.lang.String expression, Var var)
      Add an Expression as variable to the select.
      void addVar​(Var var)
      Add a variable to the select.
      void addVar​(Expr expr, Var var)
      Add an Expression as variable to the select.
      void build()
      Called by the build process for this handler to perform any adjustments to the query before the build completes.
      VarExprList getProject()
      Return the projected var expression list.
      java.util.List<Var> getVars()
      Get the list of variables from the query.
      void setDistinct​(boolean state)
      Set the distinct flag.
      void setReduced​(boolean state)
      Set the reduced flag.
      void setVars​(java.util.Map<Var,​Node> values)
      Set the values for variables managed by the handler implementation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SelectHandler

        public SelectHandler​(AggregationHandler aggHandler)
        Constructor.
        Parameters:
        aggHandler - The aggregate handler that wraps the query we want to handle.
    • Method Detail

      • setDistinct

        public void setDistinct​(boolean state)
        Set the distinct flag. Set or unset the distinct flag. Will set the reduced flag if it was previously set.
        Parameters:
        state - the state to set the distinct flag to.
      • setReduced

        public void setReduced​(boolean state)
        Set the reduced flag. Set or unset the reduced flag. Will set the reduced flag if it was previously set.
        Parameters:
        state - the state to set the reduced flag to.
      • addVar

        public void addVar​(Var var)
        Add a variable to the select. If the variable is null the variables are set to star.
        Parameters:
        var - The variable to add.
      • addVar

        public void addVar​(java.lang.String expression,
                           Var var)
        Add an Expression as variable to the select. If the variable is the variables are set to star.
        Parameters:
        expression - The expression as a string.
        var - The variable to add.
      • addVar

        public void addVar​(Expr expr,
                           Var var)
        Add an Expression as variable to the select.
        Parameters:
        expr - The expression to add.
        var - The variable to add.
      • getVars

        public java.util.List<Var> getVars()
        Get the list of variables from the query.
        Returns:
        The list of variables in the query.
      • getProject

        public VarExprList getProject()
        Return the projected var expression list.
        Returns:
        The projected var expression list.
      • addAll

        public void addAll​(SelectHandler selectHandler)
        Add all the variables from the select handler variable.
        Parameters:
        selectHandler - The select handler to copy the variables from.
      • setVars

        public void setVars​(java.util.Map<Var,​Node> values)
        Description copied from interface: Handler
        Set the values for variables managed by the handler implementation. This method is called by the builder to set values handled by this Handler implementation.
        Specified by:
        setVars in interface Handler
        Parameters:
        values - The map of variable to node value.
      • build

        public void build()
        Description copied from interface: Handler
        Called by the build process for this handler to perform any adjustments to the query before the build completes. The adjustments are made after setVars() has been called.
        Specified by:
        build in interface Handler