|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.util.concurrent.Lazy
public final class Lazy
Factory for creating lazily populated references.
Constructor Summary | |
---|---|
Lazy()
|
Method Summary | ||
---|---|---|
static
|
supplier(Supplier<T> factory)
Memoizing reference that is lazily computed using the supplied factory. |
|
static
|
timeToIdle(Supplier<T> factory,
long time,
java.util.concurrent.TimeUnit unit)
Memoizing reference that expires the specified amount of time after the last time it was accessed. |
|
static
|
timeToLive(Supplier<T> factory,
long time,
java.util.concurrent.TimeUnit unit)
Memoizing reference that expires the specified amount of time after creation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Lazy()
Method Detail |
---|
public static <T> Supplier<T> supplier(Supplier<T> factory)
The factory
is not held on to after it is used, enabling
it to be garbage collected.
T
- the type.factory
- for populating the initial value, called only once.
public static <T> Supplier<T> timeToLive(Supplier<T> factory, long time, java.util.concurrent.TimeUnit unit)
T
- the type.factory
- for populating the initial value, called only once.time
- the amountunit
- the units the amount is in
public static <T> Supplier<T> timeToIdle(Supplier<T> factory, long time, java.util.concurrent.TimeUnit unit)
T
- the type.factory
- for populating the initial value, called only once.time
- the amountunit
- the units the amount is in
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |