Class ListenableValue<T>
java.lang.Object
dev.pfaff.altargui.util.listenable.AbstractListenable
dev.pfaff.altargui.util.listenable.ListenableValue<T>
- All Implemented Interfaces:
Listenable
,ValueListenable<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ListenerDisposer
addListener
(Consumer<T> listener) Adds a listener.final boolean
atomicCompareAndSet
(T expected, T value) Identity is used instead ofequals(Object, Object)
.protected boolean
final T
value()
final void
Methods inherited from class dev.pfaff.altargui.util.listenable.AbstractListenable
addListener, addListener, forEachListener, notifyRunnableListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.pfaff.altargui.util.listenable.ValueListenable
addListener, map
-
Constructor Details
-
ListenableValue
public ListenableValue() -
ListenableValue
-
-
Method Details
-
equals
-
addListener
Description copied from interface:ValueListenable
Adds a listener. The listener may not be added again if already added. When added, it is guaranteed to be invoked immediately with the current value.- Specified by:
addListener
in interfaceValueListenable<T>
-
value
-
value
-
atomicCompareAndSet
Identity is used instead ofequals(Object, Object)
.
-