Oracle Data-aware Controls Reference

oracle.dacf.dataset
Class CalculatedAttributeInfo

java.lang.Object
  extended byoracle.dacf.dataset.DacObject
      extended byoracle.dacf.dataset.ProducerObject
          extended byoracle.dacf.dataset.InfoObject
              extended byoracle.dacf.dataset.ColumnInfo
                  extended byoracle.dacf.dataset.CalculatedAttributeInfo
All Implemented Interfaces:
ChangeListener, java.lang.Cloneable, java.util.EventListener

public class CalculatedAttributeInfo
extends ColumnInfo
implements ChangeListener

The CalculatedAttributeInfo class represents a read-only column derived from ColumnInfo. CalculatedAttributeInfo captures the notion that a given value is dependent on the values of other columns. This class, however, does not perform the calculations itself. Methods on CalculatedAttributeInfo identify "sources", where a source is a ColumnInfo object that the CalculatedAttributeInfo is dependent upon. For example, addSource adds a dependency that should be tracked by the CalculatedAttributeInfo.

CalculatedAttributeInfo tracks the changes in its dependencies. When a change occurs, it calls the calculate method on an object that implements the Calculator interface. The calculate method computes the new value and stores it through the ImmediateAccess interface into a transient column in the underlying Java Business Objects rowset.

See Also:
ColumnInfo, Calculator

Field Summary
 
Fields inherited from class oracle.dacf.dataset.ColumnInfo
DEFAULT, ERR_PROD_CODE, UPDATEABLE_IF_NEW
 
Fields inherited from class oracle.dacf.dataset.InfoObject
_updateMode, LEVEL_APPLICATION, LEVEL_ATTRIBUTE, LEVEL_COLUMN, LEVEL_QUERY_VIEW, LEVEL_ROOT, LEVEL_ROW, LEVEL_ROWSET, LEVEL_SESSION, PROPERTIES_COLUMN_NAME, UPDATEABLE_FALSE, UPDATEABLE_MAX_VAL, UPDATEABLE_TRUE, UPDATEABLE_UNDEFINED
 
Fields inherited from class oracle.dacf.dataset.ProducerObject
_openLock
 
Fields inherited from class oracle.dacf.dataset.DacObject
EMPTY_PREFIX, INITIAL_CAPACITY, ITEMNAME_DELIMITER
 
Constructor Summary
CalculatedAttributeInfo()
          Public constructor.
CalculatedAttributeInfo(int sqlType)
          Public constructor requiring the java.sql.Type of the CalculatedAttributeInfo.
CalculatedAttributeInfo(java.lang.String colName)
          Constructor requiring the name of the CalculatedAttributeInfo column.
 
Method Summary
 void addSource(ColumnInfo col)
          Adds a ColumnInfo as a source.
 void attributeChanged(AttributeChangeEvent e)
          A method defined by the ChangeListener interface, called whenever an attribute of the current row is changed.
 Calculator getCalculator()
          Returns a reference to the current Calculator.
 java.lang.String getName()
          Returns the name of the DacObject.
 RowSetInfo getRowSetInfo()
          Returns the parent RowSetInfo.
 ColumnInfo[] getSources()
          Returns a list of all of the source ColumnInfos.
 boolean isQueryable()
          Returns true if the attribute is queryable.
 void open(boolean openChildren)
          Generic method for connecting the producer objects to the server objects.
 void removeSource(ColumnInfo col)
          Removes a ColumnInfo as a source.
 void rowAdded(RowChangeEvent e)
          A method defined by the ChangeListener interface, called whenever a row has been added to a rowset.
 void rowsetCleared(RowSetChangeEvent e)
          A method defined by the ChangeListener interface, called whenever the rowset is cleared.
 void rowsetPopulated(RowSetChangeEvent e)
          A method defined by the ChangeListener interface, called whenever the rowset is populated.
 void rowToBeRemoved(RowChangeEvent e)
          A method defined by the ChangeListener interface, called whenever a before a row is removed from a rowset.
 void rowUpdated(RowChangeEvent e)
          A method defined by the ChangeListener interface, called whenever a row has been updated.
 void setCalculator(Calculator calculator)
          Specifies the Calculator that will compute the value.
 void setName(java.lang.String st)
          Sets the InfoBus bind name of the object.
 void setSources(ColumnInfo[] sources)
          Sets the source ColumnInfos.
 
Methods inherited from class oracle.dacf.dataset.ColumnInfo
clone, closeCheck, closeChildren, closeDataItems, closeProducerObject, createPropertyColumn, getAttributeDef, getColumnAlignment, getColumnIndex, getColumnName, getColumnWidth, getDataItem, getDisplayable, getDisplayed, getFormatString, getFormatter, getFormatterInfo, getImmediateAccess, getLabel, getSQLType, isDirty, isNullAllowed, isPrimaryKey, isSortingEnabled, isUpdateable, isUpdateableIfNew, isValid, openChildren, openDataItems, openProducerObject, setColumnAlignment, setColumnName, setColumnWidth, setDirty, setDisplayable, setDisplayed, setFormatString, setFormatter, setFormatterInfo, setLabel, setSortingEnabled, setUpdateableIfNew, setValid, setViewObject
 
Methods inherited from class oracle.dacf.dataset.InfoObject
addChangeListener, addValidationListener, areParentsValid, clearDirty, createChild, fireValidationEvent, forceValid, getChangeListeners, getLocale, getUpdateMode, getValidationListeners, internalValidation, isActive, processValidationEvent, removeChangeListener, removeValidationListener, setActive, setLocale, setUpdateable, toString, validate, validate, validate
 
Methods inherited from class oracle.dacf.dataset.ProducerObject
addChild, addClonedDataItem, close, findDataItem, findProducerObject, findProducerObject, getClonedDataItems, getDataItemImpl, getDataProducer, getDataSourceName, getFullName, isAClonedDataItem, isOpen, publishDataItem, publishDataItem, removeChild, removeClonedDataItem, revokeDataItem, setClonedDataItems, setDataItem, setDataSourceName, setOpen
 
Methods inherited from class oracle.dacf.dataset.DacObject
addChild, findDescendant, genCloneName, getChild, getChildIndex, getChildren, getNumOfChildren, getParent, getPrefix, insertChildAt, removeChild, removeChildren, setChildren, setParent, setPrefix
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalculatedAttributeInfo

public CalculatedAttributeInfo()
Public constructor.


CalculatedAttributeInfo

public CalculatedAttributeInfo(int sqlType)
Public constructor requiring the java.sql.Type of the CalculatedAttributeInfo.

Parameters:
sqlType - the SQL type of the attribute, according to java.sql.Types.

CalculatedAttributeInfo

public CalculatedAttributeInfo(java.lang.String colName)
Constructor requiring the name of the CalculatedAttributeInfo column.

Parameters:
colName - the name of the CalculatedAttributeInfo column.
Method Detail

setCalculator

public void setCalculator(Calculator calculator)
Specifies the Calculator that will compute the value.

The Calculator is responsible for computing the value based upon the value of the source ColumnInfo objects.

Parameters:
calculator - the Calculator that will compute the value.
See Also:
getCalculator(), Calculator

getCalculator

public Calculator getCalculator()
Returns a reference to the current Calculator.

The Calculator is responsible for computing the value based upon the value of the source ColumnInfo objects.

Returns:
a reference to the current Calculator.
See Also:
setCalculator(Calculator calculator), Calculator

addSource

public void addSource(ColumnInfo col)
Adds a ColumnInfo as a source. Adds a ColumnInfo to the list of source objects. The ordering in the list is arbitrary. It is the implementors of the Calculator interface to establish the ordering between the source ColumnInfos.

Parameters:
col - the ColumnInfo to be added as a source.
See Also:
Calculator

removeSource

public void removeSource(ColumnInfo col)
Removes a ColumnInfo as a source. Removes a ColumnInfo from the list of source objects. The ordering in the list is arbitrary. It is the implementors of the Calculator interface to establish the ordering between the source ColumnInfos.

Parameters:
col - the ColumnInfo to be added as a source.
See Also:
Calculator

getSources

public ColumnInfo[] getSources()
Returns a list of all of the source ColumnInfos.

Returns:
a list of all of the source ColumnInfoes.

setSources

public void setSources(ColumnInfo[] sources)
Sets the source ColumnInfos.

Parameters:
sources - a list of all the source ColumnInfos.

setName

public void setName(java.lang.String st)
Description copied from class: ProducerObject
Sets the InfoBus bind name of the object.

Overrides:
setName in class ColumnInfo

getName

public java.lang.String getName()
Description copied from class: DacObject
Returns the name of the DacObject.

Overrides:
getName in class ColumnInfo

getRowSetInfo

public RowSetInfo getRowSetInfo()
Returns the parent RowSetInfo.

Returns:
the parent RowSetInfo.

isQueryable

public boolean isQueryable()
Returns true if the attribute is queryable.

Queryable attributes can be used to restrict the query populating the rowset and will be displayed by the FindDialog.

Returns:
true if the attribute is queryable; false if it is not.

rowsetPopulated

public void rowsetPopulated(RowSetChangeEvent e)
A method defined by the ChangeListener interface, called whenever the rowset is populated. Used by CalculatedAttributeInfo to monitor changes to the dependent objects.

Specified by:
rowsetPopulated in interface ChangeListener
Parameters:
e - a RowChangeEvent.
See Also:
RowSetChangeEvent

rowsetCleared

public void rowsetCleared(RowSetChangeEvent e)
A method defined by the ChangeListener interface, called whenever the rowset is cleared. Used by CalculatedAttributeInfo to monitor changes to the dependent objects.

Specified by:
rowsetCleared in interface ChangeListener
Parameters:
e - a RowChangeEvent.
See Also:
RowSetChangeEvent

rowAdded

public void rowAdded(RowChangeEvent e)
A method defined by the ChangeListener interface, called whenever a row has been added to a rowset. Used by CalculatedAttributeInfo to monitor changes to the dependent objects.

Specified by:
rowAdded in interface ChangeListener
Parameters:
e - a RowChangeEvent.
See Also:
RowChangeEvent

rowUpdated

public void rowUpdated(RowChangeEvent e)
A method defined by the ChangeListener interface, called whenever a row has been updated. Used by CalculatedAttributeInfo to monitor changes to the dependent objects.

Specified by:
rowUpdated in interface ChangeListener
Parameters:
e - a RowChangeEvent.
See Also:
RowChangeEvent

rowToBeRemoved

public void rowToBeRemoved(RowChangeEvent e)
A method defined by the ChangeListener interface, called whenever a before a row is removed from a rowset. Used by CalculatedAttributeInfo to monitor changes to the dependent objects.

Specified by:
rowToBeRemoved in interface ChangeListener
Parameters:
e - a RowChangeEvent.
See Also:
RowChangeEvent

attributeChanged

public void attributeChanged(AttributeChangeEvent e)
A method defined by the ChangeListener interface, called whenever an attribute of the current row is changed. Used by CalculatedAttributeInfo to monitor changes to the dependent objects.

Specified by:
attributeChanged in interface ChangeListener
Parameters:
e - a RowChangeEvent.
See Also:
AttributeChangeEvent

open

public void open(boolean openChildren)
Description copied from class: ProducerObject
Generic method for connecting the producer objects to the server objects.

Overrides:
open in class ProducerObject
Parameters:
openChildren - true: open all of the child objects.

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.