public final class V8ValueDouble extends V8ValueNumber<java.lang.Double> implements IV8ValuePrimitiveValue<V8ValueDoubleObject>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INFINITY |
value
OBJECT_CONVERTER, v8Runtime
Constructor and Description |
---|
V8ValueDouble(V8Runtime v8Runtime)
Instantiates a new V8 value double.
|
V8ValueDouble(V8Runtime v8Runtime,
double value)
Instantiates a new V8 value double.
|
Modifier and Type | Method and Description |
---|---|
boolean |
asBoolean()
A simulation of the JS
if (variable) |
double |
asDouble()
As double.
|
int |
asInt()
As int.
|
long |
asLong()
As long.
|
boolean |
isFinite()
Is finite.
|
boolean |
isInfinite()
Is infinite.
|
boolean |
isNaN()
Is NaN.
|
V8ValueDouble |
toClone(boolean referenceCopy)
Get a clone of the current V8 value.
|
V8ValueDoubleObject |
toObject()
Convert the primitive value to the primitive object.
|
double |
toPrimitive()
To primitive double.
|
java.lang.String |
toString() |
java.lang.String |
toString(int radix)
Number.prototype.toString()
The toString() method of Number values returns a string representing this number value.
|
close, equals, getValue, isEmpty, isPresent, sameValue, strictEquals
checkV8Runtime, getV8Runtime, isClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asString, equals, getV8Runtime, isNull, isNullOrUndefined, isUndefined, sameValue, strictEquals
close, isClosed
toClone
public static final java.lang.String INFINITY
public V8ValueDouble(V8Runtime v8Runtime) throws JavetException
v8Runtime
- the V8 runtimeJavetException
- the javet exceptionpublic V8ValueDouble(V8Runtime v8Runtime, double value) throws JavetException
v8Runtime
- the V8 runtimevalue
- the valueJavetException
- the javet exceptionpublic boolean asBoolean()
IV8Value
if (variable)
public double asDouble() throws JavetException
IV8Value
asDouble
in interface IV8Value
JavetException
- the javet exceptionpublic int asInt()
IV8Value
public long asLong() throws JavetException
IV8Value
asLong
in interface IV8Value
JavetException
- the javet exceptionpublic boolean isFinite()
public boolean isInfinite()
public boolean isNaN()
public V8ValueDouble toClone(boolean referenceCopy) throws JavetException
IV8Cloneable
toClone
in interface IV8Cloneable
referenceCopy
- the reference copyJavetException
- the javet exceptionpublic V8ValueDoubleObject toObject() throws JavetException
IV8ValuePrimitiveValue
toObject
in interface IV8ValuePrimitiveValue<V8ValueDoubleObject>
JavetException
- the javet exceptionpublic double toPrimitive()
public java.lang.String toString()
toString
in class V8ValuePrimitive<java.lang.Double>
public java.lang.String toString(int radix)
radix
- An integer in the range 2 through 36 specifying the base to use for representing the number value.
Defaults to 10.