|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.datasource.BaseColumn | +--com.klg.jclass.datasource.BaseVirtualColumn
Adds columns to rows which are not retrieved from the data source.
This class allows you to add columns which are derived by performing an
operation
on one or more other columns in the row to arrive
at a new value.
The basic supported operations are:
Field Summary | |
static int |
AVERAGE
|
protected String[] |
columns
|
static int |
DIFFERENCE
|
static int |
MAX
|
static int |
MIN
|
protected int |
operation
|
static int |
PRODUCT
|
static int |
QUOTIENT
|
protected int |
roundMode
|
protected int |
scale
|
static int |
SUM
|
Fields inherited from class com.klg.jclass.datasource.BaseColumn |
catalog, columnClassName, displayWidth, identifier, isAutoIncrement, isCaseSensitive, isCurrency, isDefinitelyWritable, isNullable, isReadOnly, isSearchable, isSigned, isWritable, label, metaType, name, NOT_SET, precision, schema, table, type, typeName |
Constructor Summary | |
BaseVirtualColumn(String name,
int type,
int operation,
String[] columns)
Creates a column which is calculated based on one or more data source columns. |
Method Summary | |
String[] |
getColumns()
Returns the list of names of the columns used to derive the virtual column. |
int |
getOperation()
Returns the operation. |
Object |
getResultData(com.klg.jclass.datasource.DataTableModel dtm,
long bookmark)
Returns the value calculated by performing operation
on columns . |
int |
getRoundMode()
Returns the roundMode. |
int |
getScale(int scale)
Returns the scale which is used when dividing. |
boolean |
isReadOnly()
|
void |
setReadOnly(boolean isReadOnly)
|
void |
setRoundMode(int roundMode)
Sets the roundMode to be used when dividing. |
void |
setScale(int scale)
Sets the scale to be used when dividing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MIN
public static final int MAX
public static final int AVERAGE
public static final int SUM
public static final int DIFFERENCE
public static final int PRODUCT
public static final int QUOTIENT
protected int operation
protected String[] columns
protected int scale
protected int roundMode
Constructor Detail |
public BaseVirtualColumn(String name, int type, int operation, String[] columns)
String name = "difference";
int type = java.sql.Types.INTEGER;
int operation = BaseVirtualColumn.DIFFERENCE;
String columns[] = {"colA", "colB", "colC"}
BaseVirtualColumn bvc = new BaseVirtualColumn(name, type, operation, columns);
This example is equivalent to the difference calculation colA - colB - colC.
name
- the String name of the column to be displayed.type
- the java.sql.Types type of the column, will be automatically
mapped to a MetaDataModel type.operation
- an int constant one of MIN, MAX, AVERAGE, SUM, PRODUCT,
QUOTIENT, DIFFERENCE.columns
- an array of column identifiers indicating which columns to
use in the operation.Method Detail |
public Object getResultData(com.klg.jclass.datasource.DataTableModel dtm, long bookmark) throws DataModelException
operation
on columns
.
getResultData
in interface VirtualColumnModel
bookmark
- a long which uniquely identifies a row.
operation
on columns
.
DataModelException
- If the operation fails.public void setScale(int scale)
setScale
in interface ColumnModel
setScale
in class BaseColumn
scale
- an int which indicates the scale.getScale(int)
,
BigDecimal
public int getScale(int scale)
setScale(int)
,
BigDecimal
public void setRoundMode(int roundMode)
roundMode
- an int on of the java.math.BigDecimal
roundMode constants.BigDecimal
public int getRoundMode()
BigDecimal
public int getOperation()
public String[] getColumns()
public boolean isReadOnly()
isReadOnly
in interface ColumnModel
isReadOnly
in class BaseColumn
public void setReadOnly(boolean isReadOnly)
setReadOnly
in interface ColumnModel
setReadOnly
in class BaseColumn
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |