Class AggregateFunction

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean supportsDistinct
      If this flag is true, the aggregate function supports the DISTINCT keyword before its first argument.
    • Constructor Summary

      Constructors 
      Constructor Description
      AggregateFunction​(boolean supportsDistinct)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void addValue​(java.lang.Object value)
      Adds a value to the aggregate function so that it can update its internal state.
      abstract void clearResult()
      Clears the aggregate function's current state so that the object can be reused to compute an aggregate on another set of input values.
      abstract java.lang.Object getResult()
      Returns the aggregated result computed for this aggregate function.
      boolean supportsDistinct()  
      • Methods inherited from class edu.caltech.nanodb.functions.Function

        clone
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • supportsDistinct

        private boolean supportsDistinct
        If this flag is true, the aggregate function supports the DISTINCT keyword before its first argument.
    • Constructor Detail

      • AggregateFunction

        public AggregateFunction​(boolean supportsDistinct)
    • Method Detail

      • supportsDistinct

        public boolean supportsDistinct()
      • clearResult

        public abstract void clearResult()
        Clears the aggregate function's current state so that the object can be reused to compute an aggregate on another set of input values.
      • addValue

        public abstract void addValue​(java.lang.Object value)
        Adds a value to the aggregate function so that it can update its internal state. Generally, aggregate functions ignore null inputs (which represent SQL NULL values) when computing their results.
        Parameters:
        value - the value to add to the aggregate function
      • getResult

        public abstract java.lang.Object getResult()
        Returns the aggregated result computed for this aggregate function. Generally, if aggregate functions receive no non-null inputs then they should produce a null result. (COUNT is an exception to this rule, producing 0 in that case.)
        Returns:
        the result of the aggregate computation.