public interface Calculation<N>
It is sometimes desirable to compute single values from an entire List of objects. For example,
an EventList
may represent the ages of all customers
and it is useful to display the average age of all customers.
The average can be modeled as a Calculation
which is
updated as the contents of the EventList change and in turn broadcast PropertyChangeEvents to
registered listeners describing a change in the calculated value.
In this way, Calculation object represent a continuation of data transformation from the domain of Lists to the domain of simple Number objects calculated from the elements of those Lists.
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener pcl) |
void |
dispose()
Cease the updating of this Calculation from its data sources and free them for garbage
collection.
|
String |
getName() |
N |
getValue() |
void |
removePropertyChangeListener(PropertyChangeListener pcl) |
void |
setName(String name)
Adjusts the Calculation to have the new
name ; |
void addPropertyChangeListener(PropertyChangeListener pcl)
pcl
- a PropertyChangeListener to notify any time the value
changesvoid removePropertyChangeListener(PropertyChangeListener pcl)
pcl
- a PropertyChangeListener which should no longer be notified of value
changesString getName()
void setName(String name)
name
;name
- the new human-readable name of this CalculationN getValue()
void dispose()
Copyright © 2024 levigo holding gmbh. All rights reserved.