Class SimpleObservableIntProperty
java.lang.Object
dev.prozilla.pine.common.property.mutable.SimpleMutableIntProperty
dev.prozilla.pine.common.property.observable.SimpleObservableIntProperty
- All Implemented Interfaces:
Destructible,IntProperty,MutableIntProperty,MutableProperty<Integer>,NonNullProperty<Integer>,ObservableIntProperty,ObservableProperty<Integer>,SimpleObservableProperty<Integer>,Property<Integer>,Functor<Integer>
- Direct Known Subclasses:
DeserializedIntProperty,IntConfigOption
public class SimpleObservableIntProperty
extends SimpleMutableIntProperty
implements ObservableIntProperty, SimpleObservableProperty<Integer>
-
Field Summary
FieldsFields inherited from interface dev.prozilla.pine.common.property.observable.ObservableProperty
OBSERVER_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionSimpleObservableIntProperty(int initialValue) Creates an observable property with an initial value. -
Method Summary
Modifier and TypeMethodDescriptionaddObserver(IntObserver observer) voiddestroy()Removes all observers.protected Loggerprotected voidonValueChange(int oldValue, int newValue) Triggers all observers with the newValue whenever the value changes.voidremoveObserver(IntObserver observer) voidSets the logger of this property, which is used to log errors thrown by observers.Methods inherited from class dev.prozilla.pine.common.property.mutable.SimpleMutableIntProperty
get, setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.common.property.IntProperty
get, getValue, getValueOr, has, hasProperty, isZeroProperty, map, replaceNull, requireValueMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableIntProperty
modify, set, setValue, swap, viewPropertyMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableProperty
modifyValue, swapValueMethods inherited from interface dev.prozilla.pine.common.property.NonNullProperty
isNotNull, isNotNullPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.ObservableIntProperty
addObserver, read, read, removeObserverMethods inherited from interface dev.prozilla.pine.common.property.Property
hasValue, hasValueProperty, isNull, map, snapshot, toStringProperty
-
Field Details
-
logger
-
-
Constructor Details
-
SimpleObservableIntProperty
public SimpleObservableIntProperty(int initialValue) Creates an observable property with an initial value.- Parameters:
initialValue- The initial value
-
-
Method Details
-
addObserver
- Specified by:
addObserverin interfaceObservableIntProperty
-
removeObserver
- Specified by:
removeObserverin interfaceObservableIntProperty
-
setLogger
Description copied from interface:SimpleObservablePropertySets the logger of this property, which is used to log errors thrown by observers.- Specified by:
setLoggerin interfaceSimpleObservableProperty<Integer>
-
onValueChange
protected void onValueChange(int oldValue, int newValue) Triggers all observers with the newValue whenever the value changes.- Overrides:
onValueChangein classSimpleMutableIntProperty- Parameters:
oldValue- The previous valuenewValue- The new value
-
getLogger
-
destroy
public void destroy()Removes all observers.- Specified by:
destroyin interfaceDestructible
-