Class SolutionModifierHandler

  • All Implemented Interfaces:
    Handler

    public class SolutionModifierHandler
    extends java.lang.Object
    implements Handler
    The Solution Modifier handler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAll​(SolutionModifierHandler solutionModifier)
      Copy all the modifications from the Solution Modifier argument
      void addGroupBy​(Var var)
      Add a node to the group by clause.
      void addGroupBy​(Var var, Expr expr)
      Add var and expression to the group by clause.
      void addGroupBy​(Expr expr)
      Add an expression to the group by clause.
      void addHaving​(java.lang.String expression)
      Add a having expression.
      void addHaving​(Var var)
      Add a variable to the having clause.
      void addHaving​(Expr expr)
      Add an expression to the having clause.
      void addOrderBy​(SortCondition condition)
      Add an order by clause
      void addOrderBy​(Var var)
      Add a var to the order by clause.
      void addOrderBy​(Var var, Order order)
      Add a var to the order by clause.
      void addOrderBy​(Expr expr)
      Add an expression to the order by clause.
      void addOrderBy​(Expr expr, Order order)
      Add an expression to the order by clause.
      void build()
      Called by the build process for this handler to perform any adjustments to the query before the build completes.
      void setLimit​(int limit)
      Set the limit for the number of results to return.
      void setOffset​(int offset)
      Set the offset for the results to return.
      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

      • SolutionModifierHandler

        public SolutionModifierHandler​(Query query)
        Constructor
        Parameters:
        query - The query to modify.
    • Method Detail

      • addAll

        public void addAll​(SolutionModifierHandler solutionModifier)
        Copy all the modifications from the Solution Modifier argument
        Parameters:
        solutionModifier - The solution modifier to copy from.
      • addOrderBy

        public void addOrderBy​(SortCondition condition)
        Add an order by clause
        Parameters:
        condition - The SortCondition to add to the order by.
      • addOrderBy

        public void addOrderBy​(Expr expr)
        Add an expression to the order by clause. Sorts in Default order.
        Parameters:
        expr - The expression to add.
      • addOrderBy

        public void addOrderBy​(Expr expr,
                               Order order)
        Add an expression to the order by clause.
        Parameters:
        expr - The expression to add.
        order - The direction of the ordering.
      • addOrderBy

        public void addOrderBy​(Var var)
        Add a var to the order by clause. Sorts in default order
        Parameters:
        var - The var to use for sorting
      • addOrderBy

        public void addOrderBy​(Var var,
                               Order order)
        Add a var to the order by clause.
        Parameters:
        var - The var to sort by.
        order - The direction of the ordering.
      • addGroupBy

        public void addGroupBy​(Expr expr)
        Add an expression to the group by clause.
        Parameters:
        expr - The expression to add.
      • addGroupBy

        public void addGroupBy​(Var var)
        Add a node to the group by clause.
        Parameters:
        var - The variable to add.
      • addGroupBy

        public void addGroupBy​(Var var,
                               Expr expr)
        Add var and expression to the group by clause.
        Parameters:
        var - The variable to add.
        expr - The expression to add.
      • addHaving

        public void addHaving​(java.lang.String expression)
                       throws ParseException
        Add a having expression.
        Parameters:
        expression - The expression to add
        Throws:
        ParseException - If the expression can not be parsed.
      • addHaving

        public void addHaving​(Var var)
        Add a variable to the having clause.
        Parameters:
        var - The variable to add.
      • addHaving

        public void addHaving​(Expr expr)
        Add an expression to the having clause.
        Parameters:
        expr - The expression to add.
      • setLimit

        public void setLimit​(int limit)
        Set the limit for the number of results to return. Setting the limit to zero (0) or removes the limit.
        Parameters:
        limit - The limit to set.
      • setOffset

        public void setOffset​(int offset)
        Set the offset for the results to return. Setting the offset to zero (0) or removes the offset.
        Parameters:
        offset - The offset to set.
      • 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