public final class OCamlLazy<T extends OCamlValue> extends OCamlValue
OCamlLazy
class is the wrapper class for OCaml values of
type 'a lazy_t
.WRAPPER
Modifier and Type | Method and Description |
---|---|
static <T extends OCamlValue> |
create(T v)
Constructs a new
'a lazy_t value, and wraps it. |
static <T extends OCamlValue> |
create(Wrapper<T> w,
OCamlFunction<OCamlUnit,T> c)
Constructs a new
'a lazy_t value, and wraps it. |
boolean |
equals(java.lang.Object obj) |
T |
force()
Returns the wrapped value, by forcing it if necessary.
|
T |
get()
Returns the wrapped value.
|
Wrapper<? extends OCamlLazy<T>> |
getWrapper()
Returns the wrapper used to wrap
Value elements into
instances of the current class. |
Wrapper<? extends OCamlValue> |
getWrapper(int idx)
Returns the wrapper used to wrap
Value elements into
instances of the embedded type at given index. |
int |
hashCode() |
java.lang.String |
toString() |
static <T extends OCamlValue> |
wrap(Wrapper<T> w,
org.ocamljava.runtime.values.Value v)
Wraps the passed value.
|
static <T extends OCamlValue> |
wrapper(Wrapper<T> w)
Returns a wrapper for
OCamlLazy values. |
value, wrap, wrapper
public Wrapper<? extends OCamlLazy<T>> getWrapper()
Value
elements into
instances of the current class.getWrapper
in class OCamlValue
Value
elements into
instances of the current classpublic Wrapper<? extends OCamlValue> getWrapper(int idx)
Value
elements into
instances of the embedded type at given index.getWrapper
in class OCamlValue
idx
- index of embedded typeValue
elements into
instances of the embedded type at given index.public T get()
null
otherwisepublic T force()
public int hashCode()
hashCode
in class OCamlValue
public boolean equals(java.lang.Object obj)
equals
in class OCamlValue
public java.lang.String toString()
toString
in class OCamlValue
public static <T extends OCamlValue> OCamlLazy<T> create(T v)
'a lazy_t
value, and wraps it.v
- value to wrapOCamlLazy
instance wrapping the passed valuepublic static <T extends OCamlValue> OCamlLazy<T> create(Wrapper<T> w, OCamlFunction<OCamlUnit,T> c)
'a lazy_t
value, and wraps it.w
- wrapper for nested value - should not be null
c
- closure computing the valueOCamlLazy
instance wrapping the passed valuepublic static <T extends OCamlValue> OCamlLazy<T> wrap(Wrapper<T> w, org.ocamljava.runtime.values.Value v)
w
- wrapper for nested value - should not be null
v
- value to wrap - should not be null
OCamlLazy
instance wrapping the passed valuepublic static <T extends OCamlValue> Wrapper<? extends OCamlLazy<T>> wrapper(Wrapper<T> w)
OCamlLazy
values.w
- wrapper for nested value - should not be null
OCamlLazy
values