T
- the kind of values in this containerpublic class PriorityValue<T>
extends java.lang.Object
Constructor and Description |
---|
PriorityValue() |
Modifier and Type | Method and Description |
---|---|
T |
get()
Gets the current value with the highest priority.
|
T |
get(Priority priority)
Gets the value for a given priority.
|
boolean |
set(Priority priority,
T value)
Sets the value for a given priority.
|
public boolean set(Priority priority, T value)
priority
- the priority of value
value
- the new value, can be null
true
if the result of get()
changes because of the call of this methodpublic T get(Priority priority)
priority
- the priority for which the value is requestedset(Priority, Object)
for priority
public T get()
null