All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.jagg.AnalyticFunction Maven / Gradle / Ivy

Go to download

jAgg is a Java 5.0 API that supports “group by” operations on Lists of Java objects: aggregate operations such as count, sum, max, min, avg, and many more. It also allows custom aggregate operations.

The newest version!
package net.sf.jagg;

import net.sf.jagg.model.WindowClause;

/**
 * This interface allows for the functionality necessary to implement
 * analytic functions, based on aggregate functions.  Subclasses define all of
 * the steps of the {@link AggregateFunction Aggregation algorithm}, plus these
 * methods:
 * 
    *
  1. Deletion, with the delete method. This removes an element * from the state of the AnalyticFunction. This is used when a * sliding window applies to an analytic function and an window "slides past" * an element, such that an element is no longer being considered in the * current value of the analytic function.
  2. *
  3. Whether it accepts the windowing clause, with the * takesWindowClause method. Window clauses may not make sense * with certain analytic functions. If a window clause is supplied to such an * analytic function, then an error will result.
  4. *
* * @see AggregateFunction * * @author Randy Gettman * @since 0.9.0 */ public interface AnalyticFunction extends AggregateFunction { /** * Removes the given value from the aggregation. This assumes that the * value to be removed was already processed with the iterate * method. E.g., a "sum" aggregation will subtract this object's property * value from a sum object. * * @param value The value to delete. */ public abstract void delete(Object value); /** * Determines whether this AnalyticFunction can operate with a * window clause. Most will return true, but some * analytic-only functions don't take a window clause. For those that * return false, they must also return a non-null * WindowClause * * @return Whether this AnalyticFunction can operate with a * window clause. * @see WindowClause */ public abstract boolean takesWindowClause(); /** * For AnalyticFunctions that don't take a window clause, this * method returns the implicit WindowClause. * * @return A WindowClause if takesWindowClause * returns false, else null. * @see #takesWindowClause * @see WindowClause */ public abstract WindowClause getWindowClause(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy