Class Hierarchy Index
Interface COM.cloudscape.aggregates.AggregateDefinition
- public interface AggregateDefinition
Copyright © 1998-1999, Cloudscape, Inc. All rights reserved.
An AggregateDefinition defines an aggregate. It is used
by Cloudscape during query compilation to determine what
Aggregator is used to aggregate a particular data type
and what datatype the Aggregator will emit. A single
AggregateDefinition may map to one or more Aggregators
depending on the input type. For example, a user defined
STDEV aggregate may use one aggregator implementation for the
INTEGER type and another for a user defined type that implements
a point. In this case, both the aggregators would have a
single AggregateDefinition that would chose the appropriate
aggregator based on the input type. On the other hand, if
only a single aggregator is needed to aggregate over all
of the input types (e.g. COUNT()), then it may be convenient
to implement both the AggregateDefinition and the Aggregator
interfaces by the same class.
Cloudscape reserves the right to change, rename, or
remove this interface at any time.
- See Also:
- Aggregator, TypeDescriptor, TypeFactory, getTypeFactory
-
getAggregator(TypeDescriptor, StringBuffer)
- Get the aggregator that performs the aggregation on the
input datatype at execution time.
getAggregator
public abstract TypeDescriptor getAggregator(TypeDescriptor inputType,
StringBuffer aggregatorClassName)
- Get the aggregator that performs the aggregation on the
input datatype at execution time. If the input type can be handled,
return a type descriptor with the resultant type information and
fill in the string buffer with the name of the class that
is used to perform the aggregation over the input type.
If the aggregate cannot be performed on this type, then
a null should be returned.
The aggregator class must implement a zero argument
constructor. The aggregator class can be the same class
as the AggregateDefinition if it implements both interfaces.
The result datatype may be the same as the input datatype
or a different datatype. To create your own type descriptor
to return to this method, see COM.cloudscape.types.TypeFactory.
- Parameters:
- inputType - the input type descriptor
- aggregatorClassName - output parameter, filled in
with the class name that implements COM.cloudscape.aggregates.Aggregator
- Returns:
- the output type descriptor (which may or may not
be the same as the input type -- it is ok to simply
return the input type). Null is returned
if the aggregate cannot process the input type.
Note that the output type may be a type that maps
directly to a standard SQL (e.g. java.lang.Integer)
or any other java type (e.g. java.sql.ResultSet,
java.util.Vector, java.util.TimeZone or whatever).
To construct a type descriptor see COM.cloudscape.types.TypeFactory.
- See Also:
- TypeDescriptor, TypeFactory, Aggregator
Class Hierarchy Index