public interface ValueDelegate<V>
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ValueDelegateEventListener<V> listener)
Registers the specified listener to be notified whenever the atomic value is updated.
|
void |
close()
Closes the counter.
|
V |
get()
Gets the current value.
|
V |
getAndSet(V value)
Atomically sets to the given value and returns the old value.
|
void |
removeListener(ValueDelegateEventListener<V> listener)
Unregisters the specified listener such that it will no longer receive atomic value update notifications.
|
void |
set(V value)
Sets to the given value.
|
V get()
V getAndSet(V value)
value - the new valuevoid set(V value)
value - new valuevoid addListener(ValueDelegateEventListener<V> listener)
listener - listener to notify about eventsvoid removeListener(ValueDelegateEventListener<V> listener)
listener - listener to unregistervoid close()
Copyright © 2013–2018. All rights reserved.