Package uk.ac.manchester.spinnaker.utils
Class ValueHolder<T>
java.lang.Object
uk.ac.manchester.spinnaker.utils.ValueHolder<T>
- Type Parameters:
- T- The type of value to hold.
A simple class that can optionally hold a single value. This class is
 modifiable.
- Author:
- Donal Fellows
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
ValueHolderpublic ValueHolder()Create an instance. The initial value held isnull.
- 
ValueHolderCreate an instance.- Parameters:
- value- The initial value to hold.
 
 
- 
- 
Method Details- 
getValueGet the value held.- Returns:
- The value held.
 
- 
setValueSet the value to hold.- Parameters:
- value- The new value to hold.
 
- 
updateApplies a function to update the value of this instance, returning the old value.- Parameters:
- function- The operation to apply.
- Returns:
- The old value.
 
 
-