类 LongProperty
java.lang.Object
com.iohao.game.common.kit.beans.property.LongProperty
- 所有已实现的接口:
PropertyValueObservable<Number>
long - 属性具备监听特性。当值发生变更时,会触发监听事件。
var property = new LongProperty();
// add listener monitor property object
property.addListener((observable, oldValue, newValue) -> {
log.info("oldValue:{}, newValue:{}", oldValue, newValue);
});
property.get(); // value is 0
property.set(22); // When the value changes,listeners are triggered
property.get(); // value is 22
- 作者:
- 渔民小镇
- 日期:
- 2024-04-17
-
字段概要
-
构造器概要
-
方法概要
修饰符和类型方法说明void
addListener
(PropertyChangeListener<? super Number> listener) add ChangeListenervoid
current value - 1long
get()
get current valuegetValue()
get PropertyValuevoid
current value + 1protected void
void
removeListener
(PropertyChangeListener<? super Number> listener) remove ChangeListenervoid
set
(long newValue) set current valuevoid
set value
-
字段详细资料
-
valid
protected boolean valid
-
-
构造器详细资料
-
LongProperty
public LongProperty() -
LongProperty
public LongProperty(long value)
-
-
方法详细资料
-
getValue
从接口复制的说明:PropertyValueObservable
get PropertyValue- 返回:
- current value
-
setValue
从接口复制的说明:PropertyValueObservable
set value- 参数:
value
- value
-
get
public long get()get current value- 返回:
- current value
-
set
public void set(long newValue) set current value- 参数:
newValue
- current new value
-
increment
public void increment()current value + 1 -
decrement
public void decrement()current value - 1 -
addListener
从接口复制的说明:PropertyValueObservable
add ChangeListener- 指定者:
addListener
在接口中PropertyValueObservable<T>
- 参数:
listener
- ChangeListener
-
removeListener
从接口复制的说明:PropertyValueObservable
remove ChangeListener- 指定者:
removeListener
在接口中PropertyValueObservable<T>
- 参数:
listener
- ChangeListener
-
markInvalid
protected void markInvalid()
-