org.eclipse.wst.jsdt.chromium.util

## Class LazyConstructable<T>

- java.lang.Object
- - org.eclipse.wst.jsdt.chromium.util.LazyConstructable<T>

    public class LazyConstructable<T>
    extends java.lang.Object

Holds a value yet-to-be-constructed. It gets constructed when method `get()` is called the first time. User must provide `LazyConstructable.Factory` that actually constructs the value. Once the value is constructed, the factory is released and may be collected by Java GC.

Threads: the class is thread-safe; how it's implementation is lock-free, so a factory may be called several times from several concurrent threads. However method `get()` is guaranteed to always return the same value from to whatever thread.

### Nested Class Summary

Nested Classes
`static interface` `LazyConstructable.Factory<T>`

### Constructor Summary

Constructors
Constructor and Description
`LazyConstructable(LazyConstructable.Factory<T> factory)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static <T> LazyConstructable<T>` `create(LazyConstructable.Factory<T> factory)`
`T` `get()` Constructs a value when called first time and returns it to all subsequent calls.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### LazyConstructable

    public LazyConstructable(LazyConstructable.Factory<T> factory)

### Method Detail

#### create

    public static <T> LazyConstructable<T> create(LazyConstructable.Factory<T> factory)

#### get

    public T get()

Constructs a value when called first time and returns it to all subsequent calls.