saffron.ext
Class Nth
java.lang.Object
|
+--saffron.ext.Nth
- All Implemented Interfaces:
- AggregationExtender
- public class Nth
- extends Object
- implements AggregationExtender
Nth
is an example of a custom aggregation. It returns the the
nth of a set of rows, or returns null (0 for a primitive
type) if there are not that many rows.
It implements the overloaded T aggregate(T)
method for T =
{int
, double
, Object
}. There is a
start, next, and result method for each.
- Since:
- 11 February, 2002
- Version:
- $Id: //open/saffron/src/main/saffron/ext/Nth.java#1 $
- Author:
- jhyde
Field Summary |
private int |
n
|
Constructor Summary |
Nth(int n)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
n
private int n
Nth
public Nth(int n)
aggregate
public int aggregate(int value)
start
public Object start(int value)
next
public Object next(int value,
Object accumulator)
result
public int result(int value,
Object accumulator)
aggregate
public double aggregate(double value)
start
public Object start(double value)
next
public Object next(double value,
Object accumulator)
result
public double result(double value,
Object accumulator)
aggregate
public Object aggregate(Object value)
start
public Object start(Object value)
next
public Object next(Object value,
Object accumulator)
result
public Object result(Object value,
Object accumulator)