public final class OCamlNativeInt extends OCamlValue implements OCamlNumber
OCamlNativeInt
class is the wrapper class for OCaml values of
type nativeint
.Modifier and Type | Field and Description |
---|---|
static Wrapper<OCamlNativeInt> |
WRAPPER
Wrapper for
OCamlNativeInt values. |
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Returns the wrapped value as a
byte , rounding and/or
truncating it if necessary. |
static OCamlNativeInt |
create(long v)
Constructs a new
nativeint value, and wraps it. |
double |
doubleValue()
Returns the wrapped value as a
double , rounding and/or
truncating it if necessary. |
boolean |
equals(java.lang.Object obj) |
float |
floatValue()
Returns the wrapped value as a
float , rounding and/or
truncating it if necessary. |
Wrapper<? extends OCamlNativeInt> |
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() |
int |
intValue()
Returns the wrapped value as a
int , rounding and/or
truncating it if necessary. |
long |
longValue()
Returns the wrapped value as a
long , rounding and/or
truncating it if necessary. |
short |
shortValue()
Returns the wrapped value as a
short , rounding and/or
truncating it if necessary. |
java.lang.String |
toString() |
static OCamlNativeInt |
wrap(org.ocamljava.runtime.values.Value v)
Wraps the passed value.
|
static Wrapper<? extends OCamlNativeInt> |
wrapper()
Returns a wrapper for
OCamlNativeInt values. |
value
public static final Wrapper<OCamlNativeInt> WRAPPER
OCamlNativeInt
values.public Wrapper<? extends OCamlNativeInt> 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 byte byteValue()
byte
, rounding and/or
truncating it if necessary.byteValue
in interface OCamlNumber
byte
public double doubleValue()
double
, rounding and/or
truncating it if necessary.doubleValue
in interface OCamlNumber
double
public float floatValue()
float
, rounding and/or
truncating it if necessary.floatValue
in interface OCamlNumber
float
public int intValue()
int
, rounding and/or
truncating it if necessary.intValue
in interface OCamlNumber
int
public long longValue()
long
, rounding and/or
truncating it if necessary.longValue
in interface OCamlNumber
long
public short shortValue()
short
, rounding and/or
truncating it if necessary.shortValue
in interface OCamlNumber
short
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 OCamlNativeInt create(long v)
nativeint
value, and wraps it.v
- value to wrapOCamlNativeInt
instance wrapping the passed valuepublic static OCamlNativeInt wrap(org.ocamljava.runtime.values.Value v)
v
- value to wrap - should not be null
OCamlNativeInt
instance wrapping the passed valuepublic static Wrapper<? extends OCamlNativeInt> wrapper()
OCamlNativeInt
values.OCamlNativeInt
values