public abstract class AbstractCalculation<N> extends Object implements Calculation<N>
Constructor and Description |
---|
AbstractCalculation(N initialValue) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener pcl) |
protected void |
fireValueChange(N oldValue,
N newValue)
A convenience method for firing a PropertyChangeEvent describing a change in the value of this
calculation.
|
String |
getName() |
N |
getValue() |
void |
removePropertyChangeListener(PropertyChangeListener pcl) |
void |
setName(String name)
Adjusts the Calculation to have the new
name ; |
protected void |
setValue(N value)
Subclasses should call this method in order to update the value that is reported from this
calculation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose
public AbstractCalculation(N initialValue)
initialValue
- the value that should immediately be reported as the value of this
Calculationpublic void addPropertyChangeListener(PropertyChangeListener pcl)
addPropertyChangeListener
in interface Calculation<N>
pcl
- a PropertyChangeListener to notify any time the value
changespublic void removePropertyChangeListener(PropertyChangeListener pcl)
removePropertyChangeListener
in interface Calculation<N>
pcl
- a PropertyChangeListener which should no longer be notified of value
changespublic String getName()
getName
in interface Calculation<N>
public void setName(String name)
Calculation
name
;setName
in interface Calculation<N>
name
- the new human-readable name of this Calculationpublic N getValue()
getValue
in interface Calculation<N>
protected void setValue(N value)
fireValueChange(Object, Object)
.value
- the new value of this calculationprotected void fireValueChange(N oldValue, N newValue)
oldValue
- the old value reported from this calculationnewValue
- the new value reported from this calculationCopyright © 2024 levigo holding gmbh. All rights reserved.