bibliothek.gui.dock.util
Class PriorityValue<T>

java.lang.Object
  extended by bibliothek.gui.dock.util.PriorityValue<T>
Type Parameters:
T - the kind of values in this container
Direct Known Subclasses:
UIPriorityValue

public class PriorityValue<T>
extends Object

A container for three values of different priority.

Author:
Benjamin Sigg

Constructor Summary
PriorityValue()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityValue

public PriorityValue()
Method Detail

set

public boolean set(Priority priority,
                   T value)
Sets the value for a given priority.

Parameters:
priority - the priority of value
value - the new value, can be null
Returns:
true if the result of get() changes because of the call of this method

get

public T get(Priority priority)
Gets the value for a given priority.

Parameters:
priority - the priority for which the value is requested
Returns:
the value that was set(Priority, Object) for priority

get

public T get()
Gets the current value with the highest priority.

Returns:
the value or null