borland Packages  Class Hierarchy  jbcl.dataset Package  Index 

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, an aggregate value, or a lookup. 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 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 set and whenever a row is posted. For more information on using calculated columns, see Using calculated columns in the Database Application Developer's Guide.

When working with lookup fields, set the Column component's calcType property to LOOKUP and its pickList property to a PickListDescriptor which describes the lookup relationship. In particular, the PickListDescriptor property of LookupDisplayColumn must be set to the Column to display for the lookup values.

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 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.

LOOKUP

  public static final int LOOKUP = 3
Constant used to designate that this column gets its value from a Column in another DataSet. The Column.PickList property must be set with the PickList.LookupDisplayColumn set to a non-null value for the lookup to work.

This variable was added in JBuilder 2.0.

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.