public abstract class AbstractCompositeCalculation<N extends Number> extends AbstractCalculation<N> implements PropertyChangeListener
When any of the input Calculations change their value, this composite Calculation responds by recomputing its own value.
Modifier | Constructor and Description |
---|---|
protected |
AbstractCompositeCalculation(Calculation<? extends Number>... inputs)
Combines the given
inputs with the logic in recompute(java.lang.Number[]) to produce the
value of this Calculation. |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Cease the updating of this Calculation from its data sources and free them for garbage
collection.
|
void |
propertyChange(PropertyChangeEvent evt)
When any of the input Calculations report a change, this composite calculation is also
recalculated in response.
|
protected abstract N |
recompute(Number[] inputs)
Provides the logic to combine the
inputs into the single numeric value of this
composite calculation. |
addPropertyChangeListener, fireValueChange, getName, getValue, removePropertyChangeListener, setName, setValue
protected AbstractCompositeCalculation(Calculation<? extends Number>... inputs)
inputs
with the logic in recompute(java.lang.Number[])
to produce the
value of this Calculation.inputs
- smaller Calculations to combine to produce this Calculationpublic void dispose()
Calculation
dispose
in interface Calculation<N extends Number>
protected abstract N recompute(Number[] inputs)
inputs
into the single numeric value of this
composite calculation. The inputs can be combined using any desirable arithmetic expression.inputs
- the values of the composed Calculationspublic void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
Copyright © 2024 levigo holding gmbh. All rights reserved.