X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcache%2FComputedValue.java;h=4acafe6a432d8e3f224609148ecc4fd3579302c7;hb=7d3754ca3d757ef89241cdbd679f82941e64cfc6;hp=24bbe5b0c159477bf053f34da32e3322ec3b2b31;hpb=d76c1c5b113e82739f8e0ae92288ba120d747111;p=utils diff --git a/support/general/src/main/java/org/wamblee/cache/ComputedValue.java b/support/general/src/main/java/org/wamblee/cache/ComputedValue.java index 24bbe5b0..4acafe6a 100644 --- a/support/general/src/main/java/org/wamblee/cache/ComputedValue.java +++ b/support/general/src/main/java/org/wamblee/cache/ComputedValue.java @@ -63,7 +63,7 @@ public class ComputedValue { private Computation computedValue; private Boolean busy; - private T value; + private T value; /** * Constructs the compute guard @@ -77,7 +77,7 @@ public class ComputedValue { lock = aLock; computedValue = aComputation; busy = false; - value = null; + value = null; } /** @@ -122,24 +122,27 @@ public class ComputedValue { return value; } } - + /** - * Gets the currently cached value. No recomputation is performed. - * @return Cached value. + * Gets the currently cached value. No recomputation is performed. + * + * @return Cached value. */ - public T getCached() { - synchronized(lock) { - return value; + public T getCached() { + synchronized (lock) { + return value; } - + } - + /** - * Sets the value explicitly. - * @param aValue value to set. + * Sets the value explicitly. + * + * @param aValue + * value to set. */ - public void set(T aValue) { - synchronized(lock) { + public void set(T aValue) { + synchronized (lock) { value = aValue; } }