net.sf.saffron.ext
Class Nth
java.lang.Object
|
+--net.sf.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/net/sf/saffron/ext/Nth.java#2 $
- 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)
aggregate
public double aggregate(double value)
aggregate
public Object aggregate(Object value)
next
public Object next(int value,
Object accumulator)
next
public Object next(double value,
Object accumulator)
next
public Object next(Object value,
Object accumulator)
result
public int result(int value,
Object accumulator)
result
public double result(double value,
Object accumulator)
result
public Object result(Object value,
Object accumulator)
start
public Object start(int value)
start
public Object start(double value)
start
public Object start(Object value)