|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.utils.Lazy<T>
public abstract class Lazy<T>
Utility class for lazy initialization of objects.
THREAD-UNSAFE!
Field Summary | |
---|---|
protected T |
obj
|
Constructor Summary | |
---|---|
Lazy()
|
Method Summary | |
---|---|
protected abstract T |
create()
Creates lazy initialized object. |
T |
get()
Synonym for getVal() . |
T |
getVal()
Deprecated. |
void |
set(T val)
Sets value that should be returned via get() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected T obj
Constructor Detail |
---|
public Lazy()
Method Detail |
---|
protected abstract T create()
public T getVal()
create()
(UNSYNCHRONIZED CREATION!)public T get()
getVal()
.
public void set(T val)
get()
.
val
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |