Top Description Fields Constructors Methods
org.hsqldb

public Class SetFunctionValueAggregate

extends Object
implements SetFunction
Class Inheritance
All Implemented Interfaces
org.hsqldb.SetFunction
Imports
java.math.BigDecimal, .BigInteger, .RoundingMode, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.ArraySort, .HashSet, .Iterator, org.hsqldb.map.ValuePool, org.hsqldb.types.DTIType, .HsqlDateTime, .IntervalMonthData, .IntervalSecondData, .IntervalType, .NumberType, .TimeData, .TimestampData, .Type, .TypedComparator, .Types

Implementation of SQL set function values (only for aggregate functions). This reduces temporary Object creation by SUM and AVG functions for INTEGER and narrower types.
Authors
Campbell Burnet (campbell-burnet@users dot sourceforge.net), Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.2
Version
2.7.3

Field Summary

Modifier and TypeField and Description
private final TypedComparator
private long
private BigDecimal
private double
private Object
private HashSet<Object>
private boolean
private long
private boolean
private long
private boolean
private final boolean
private long
pack-priv static final BigInteger
multiplier

Maintain the sum of multiple long values without creating a new BigInteger object for each addition.

private long
n

private final Type
private boolean
private final Session
private final int
private double
private boolean
private final Type
private final int
private double

Constructor Summary

AccessConstructor and Description
pack-priv
SetFunctionValueAggregate(Session session, int setType, Type type, Type returnType, boolean isDistinct)

Method Summary

Modifier and TypeMethod and Description
public void
add(Object itemLeft, Object itemRight)

Implements org.hsqldb.SetFunction.add.

public void
private void
private void
public void
private void
addLong(long value)

private void
private BigInteger
private Double
private Double
public Object
private Double
private Double
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

comparatorback to summary
private final TypedComparator comparator
countback to summary
private long count
currentBigDecimalback to summary
private BigDecimal currentBigDecimal
currentDoubleback to summary
private double currentDouble
currentValueback to summary
private Object currentValue
distinctValuesback to summary
private HashSet<Object> distinctValues
everyback to summary
private boolean every
fractionback to summary
private long fraction
hasNullback to summary
private boolean hasNull
hiLongback to summary
private long hiLong
initializedback to summary
private boolean initialized
isDistinctback to summary
private final boolean isDistinct
loLongback to summary
private long loLong
multiplierback to summary
pack-priv static final BigInteger multiplier

Maintain the sum of multiple long values without creating a new BigInteger object for each addition.

nback to summary
private long n
returnTypeback to summary
private final Type returnType
sampleback to summary
private boolean sample
sessionback to summary
private final Session session
setTypeback to summary
private final int setType
skback to summary
private double sk
someback to summary
private boolean some
typeback to summary
private final Type type
typeCodeback to summary
private final int typeCode
vkback to summary
private double vk

Constructor Detail

SetFunctionValueAggregateback to summary
pack-priv SetFunctionValueAggregate(Session session, int setType, Type type, Type returnType, boolean isDistinct)

Method Detail

addback to summary
public void add(Object itemLeft, Object itemRight)

Implements org.hsqldb.SetFunction.add.

addback to summary
public void add(Object item)

Implements org.hsqldb.SetFunction.add.

addDataGroupback to summary
private void addDataGroup(SetFunctionValueAggregate value)
addDataPointback to summary
private void addDataPoint(Number x)
addGroupback to summary
public void addGroup(SetFunction group)

Implements org.hsqldb.SetFunction.addGroup.

addLongback to summary
private void addLong(long value)
addLongGroupback to summary
private void addLongGroup(SetFunctionValueAggregate item)
getLongSumback to summary
private BigInteger getLongSum()
getStdDevback to summary
private Double getStdDev()
getStdDevOrZeroback to summary
private Double getStdDevOrZero()
getValueback to summary
public Object getValue()

Implements org.hsqldb.SetFunction.getValue.

getVarianceback to summary
private Double getVariance()
getVarianceOrZeroback to summary
private Double getVarianceOrZero()
resetback to summary
public void reset()

Implements org.hsqldb.SetFunction.reset.