borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.dataset 

CalcType class

java.lang.Object
   +----borland.jbcl.dataset.CalcType

About the CalcType class

Variables  Properties  Methods  
The CalcType class defines the types of calculations that a Column may involve: no calculations, a calculated value, or an aggregate value. Use the constants defined in this class with the calcType property of a Column component.

When you set the calcType property to AGGREGATE, you must also set the associated aggregation properties in the AggDescriptor object. These properties indicate the Columm to perform the aggregation on, subtotal grouping, and the type of aggregator operation (sum, count, minimum value or maximum value). You access the AggDescriptor object through the agg property in the JBuilder Component Inspector.

When working with calculated fields, set the Column component's calcType property to CALC, then set the code for the calculation in the Column component's calcFields event handler. The calcFields event handler method is called for calculated columns whenever a field value is saved and whenever a row is posted. For more information on using calculated columns, see Using calculated columns in the Database Application Developer's Guide.

For examples of applications that use calculated values, see the following projects in the specified directories of your JBuilder installation:


CalcType variables

Variables implemented in this class

CalcType properties

*Read-only properties **Write-only properties

Properties implemented in java.lang.Object

CalcType methods

Methods implemented in this class

Methods implemented in java.lang.Object


CalcType variables

AGGREGATE

  public static final int AGGREGATE = 2
Constant used to designate a calculated field that that summarizes across multiple rows. To work with an aggregation calculation, set the agg property of the Column to the AggDescriptor object that contains the properties associated with the aggregation.

CALC

  public static final int CALC = 1
Constant used to designate a basic calculated field that is updated by the calcFields event of a Column when rows are changed or added.

NO_CALC

  public static final int NO_CALC = 0
Constant used to designate that a calculation is not used for this Column.

CalcType methods

valid(int)

  public static final boolean valid(int calcType)
Returns true if the specified int is a recognized calcType variable, otherwise, returns false.