|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.Holder<V>
public abstract class Holder<V>
Convenience class that makes it a little simpler to write a lazily evalated value.
Use as follows. Instead of writing:
List<String> _list; public List<String> list() { if (_list == null) { _list = initialzeList(); } return _list; }You write:
Holder<List<String>> _list = new Holder<List<String>>() { protected List<String> initialValue() { return initializeList(); } }You then access the value by
_list.get().indexOf("foo")
etc.
Constructor Summary | |
---|---|
Holder()
|
Method Summary | |
---|---|
V |
get()
Returns the value held by this . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Holder()
Method Detail |
---|
public V get()
this
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |