Class SimpleMutableIntProperty
java.lang.Object
dev.prozilla.pine.common.property.mutable.SimpleMutableIntProperty
- All Implemented Interfaces:
IntProperty,MutableIntProperty,MutableProperty<Integer>,NonNullProperty<Integer>,Property<Integer>,Functor<Integer>
- Direct Known Subclasses:
RangedMutableIntProperty,SimpleObservableIntProperty
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleMutableIntProperty(int initialValue) Creates a mutable property with an initial value. -
Method Summary
Modifier and TypeMethodDescriptionintget()Returns the primitive value of this property.protected voidonValueChange(int oldValue, int newValue) This method is called whenever the value of this property changes.booleanset(int value) Sets the value of this property.Methods 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
getValue, getValueOr, has, hasProperty, isZeroProperty, map, replaceNull, requireValueMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableIntProperty
modify, 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.Property
hasValue, hasValueProperty, isNull, map, snapshot, toStringProperty
-
Constructor Details
-
SimpleMutableIntProperty
public SimpleMutableIntProperty(int initialValue) Creates a mutable property with an initial value.- Parameters:
initialValue- The initial value
-
-
Method Details
-
set
public boolean set(int value) Description copied from interface:MutableIntPropertySets the value of this property.- Specified by:
setin interfaceMutableIntProperty- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
onValueChange
protected void onValueChange(int oldValue, int newValue) This method is called whenever the value of this property changes.The default implementation does nothing.
- Parameters:
oldValue- The previous valuenewValue- The new value
-
get
public int get()Description copied from interface:IntPropertyReturns the primitive value of this property.- Specified by:
getin interfaceIntProperty- Returns:
- The primitive value of this property.
-