Interface IAttribute<T extends Number>
- Type Parameters:
T- the type of the numeric value
- All Known Implementing Classes:
Attribute, RangeAttribute
public interface IAttribute<T extends Number>
Interface representing an observable property that holds a numeric value. It provides methods to get and set the value, add and remove listeners,
and add and remove modifiers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(PropertyChangeListener listener) Adds a PropertyChangeListener to the listener list.voidaddModifier(AttributeModifier<T> modifier) Adds a PropertyModifier to this property.Gets the current value of the attribute, including any modifications.getValue()Gets the base value of the attribute.voidmodify(AttributeModifier<T> modifier) Modifies the value of this property using the specified PropertyModifier.voidmodify(Modification modification, double value) Modifies the value of this property using the specified modification type and value.voidremoveListener(PropertyChangeListener listener) Removes a PropertyChangeListener from the listener list.voidremoveModifier(AttributeModifier<T> modifier) Removes a PropertyModifier from this property.voidSets a new value for this property.
-
Method Details
-
getValue
-
getModifiedValue
T getModifiedValue()Gets the current value of the attribute, including any modifications.- Returns:
- the current value
-
setValue
Sets a new value for this property.- Parameters:
newValue- the new value to set
-
addListener
Adds a PropertyChangeListener to the listener list.- Parameters:
listener- the PropertyChangeListener to be added
-
removeListener
Removes a PropertyChangeListener from the listener list.- Parameters:
listener- the PropertyChangeListener to be removed
-
addModifier
Adds a PropertyModifier to this property.- Parameters:
modifier- the PropertyModifier to be added
-
removeModifier
Removes a PropertyModifier from this property.- Parameters:
modifier- the PropertyModifier to be removed
-
modify
Modifies the value of this property using the specified PropertyModifier.- Parameters:
modifier- the PropertyModifier to apply
-
modify
Modifies the value of this property using the specified modification type and value.- Parameters:
modification- the type of modification to applyvalue- the value to use for the modification
-