public class LuaDouble extends LuaNumber
LuaNumber which can hold a Java double as its value.
These instance are not instantiated directly by clients, but indirectly
via the static functions LuaValue.valueOf(int) or LuaValue.valueOf(double)
functions. This ensures that values which can be represented as int
are wrapped in LuaInteger instead of LuaDouble.
Almost all API's implemented in LuaDouble are defined and documented in LuaValue.
However the constants NAN, POSINF, NEGINF,
JSTR_NAN, JSTR_POSINF, and JSTR_NEGINF may be useful
when dealing with Nan or Infinite values.
LuaDouble also defines functions for handling the unique math rules of lua devision and modulo in
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
JSTR_NAN
Constant String representation for NaN (not a number), "nan"
|
static String |
JSTR_NEGINF
Constant String representation for negative infinity, "-inf"
|
static String |
JSTR_POSINF
Constant String representation for positive infinity, "inf"
|
static LuaDouble |
NAN
Constant LuaDouble representing NaN (not a number)
|
static LuaDouble |
NEGINF
Constant LuaDouble representing negative infinity
|
static LuaDouble |
POSINF
Constant LuaDouble representing positive infinity
|
s_metatableADD, BAND, BNOT, BOR, BXOR, CALL, CONCAT, DIV, EMPTYSTRING, ENV, EQ, FALSE, IDIV, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SHL, SHR, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, uservalue, ZERO| 限定符和类型 | 方法和说明 |
|---|---|
LuaValue |
add(double lhs)
|
LuaValue |
add(LuaValue rhs)
Add: Perform numeric add operation with another value
including metatag processing.
|
LuaValue |
band(long lhs) |
LuaValue |
band(LuaValue rhs) |
LuaValue |
bnot() |
LuaValue |
bor(long lhs) |
LuaValue |
bor(LuaValue rhs) |
LuaValue |
bxor(long lhs) |
LuaValue |
bxor(LuaValue rhs) |
double |
checkdouble()
|
int |
checkint()
|
LuaInteger |
checkinteger()
|
String |
checkjstring()
Convert this value to a Java String.
|
long |
checklong()
|
LuaNumber |
checknumber()
|
LuaString |
checkstring()
Check that this is a lua string, or throw
LuaError if it is not. |
static double |
ddiv_d(double lhs,
double rhs)
Divide two double numbers according to lua math, and return a double result.
|
static LuaValue |
ddiv(double lhs,
double rhs)
Divide two double numbers according to lua math, and return a
LuaValue result. |
LuaValue |
div(double rhs)
Divide: Perform numeric divide operation by another value
of double type without metatag processing
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.div(LuaValue) must be used |
LuaValue |
div(long rhs)
Divide: Perform numeric divide operation by another value
of int type without metatag processing
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.div(LuaValue) must be used |
LuaValue |
div(LuaValue rhs)
Divide: Perform numeric divide operation by another value
of unknown type,
including metatag processing.
|
LuaValue |
divInto(double lhs)
|
static double |
dmod_d(double lhs,
double rhs)
Take modulo for double numbers according to lua math, and return a double result.
|
static LuaValue |
dmod(double lhs,
double rhs)
Take modulo double numbers according to lua math, and return a
LuaValue result. |
boolean |
eq_b(LuaValue val)
Equals: Perform equality comparison with another value
including metatag processing using
LuaValue.EQ,
and return java boolean |
LuaValue |
eq(LuaValue val)
Equals: Perform equality comparison with another value
including metatag processing using
LuaValue.EQ. |
boolean |
equals(Object o) |
boolean |
gt_b(double rhs)
Greater than: Perform numeric or string comparison with another value
of unknown type, including metatag processing,
and returning java boolean.
|
boolean |
gt_b(long rhs)
Greater than: Perform numeric comparison with another value
of int type,
including metatag processing,
and returning java boolean.
|
boolean |
gt_b(LuaValue rhs)
Greater than: Perform numeric or string comparison with another value
of unknown type, including metatag processing,
and returning java boolean.
|
LuaValue |
gt(double rhs)
Greater than: Perform numeric comparison with another value
of double type,
including metatag processing, and returning
LuaValue. |
LuaValue |
gt(long rhs)
Greater than: Perform numeric comparison with another value
of int type,
including metatag processing, and returning
LuaValue. |
LuaValue |
gt(LuaValue rhs)
Greater than: Perform numeric or string comparison with another value
of unknown type,
including metatag processing, and returning
LuaValue. |
boolean |
gteq_b(double rhs)
Greater than or equals: Perform numeric comparison with another value
of double type,
including metatag processing,
and returning java boolean.
|
boolean |
gteq_b(long rhs)
Greater than or equals: Perform numeric comparison with another value
of int type,
including metatag processing,
and returning java boolean.
|
boolean |
gteq_b(LuaValue rhs)
Greater than or equals: Perform numeric or string comparison with another value
of unknown type, including metatag processing,
and returning java boolean.
|
LuaValue |
gteq(double rhs)
Greater than or equals: Perform numeric comparison with another value
of double type,
including metatag processing, and returning
LuaValue. |
LuaValue |
gteq(long rhs)
Greater than or equals: Perform numeric comparison with another value
of int type,
including metatag processing, and returning
LuaValue. |
LuaValue |
gteq(LuaValue rhs)
Greater than or equals: Perform numeric or string comparison with another value
of unknown type,
including metatag processing, and returning
LuaValue. |
int |
hashCode() |
LuaValue |
idiv(long lhs) |
LuaValue |
idiv(LuaValue rhs) |
boolean |
isint()
Check if
this is a number and is representable by java int
without rounding or truncation |
boolean |
isinttype()
Check if
this is a LuaInteger
No attempt to convert from string will be made by this call. |
boolean |
islong()
Check if
this is a number and is representable by java long
without rounding or truncation |
boolean |
isnumber()
Check if
this is a number |
boolean |
isstring()
Check if
this is a string |
boolean |
isvalidkey()
Return true if this is a valid key in a table index operation.
|
boolean |
lt_b(double rhs)
Less than: Perform numeric or string comparison with another value
of unknown type, including metatag processing,
and returning java boolean.
|
boolean |
lt_b(long rhs)
Less than: Perform numeric comparison with another value
of int type,
including metatag processing,
and returning java boolean.
|
boolean |
lt_b(LuaValue rhs)
Less than: Perform numeric or string comparison with another value
of unknown type, including metatag processing,
and returning java boolean.
|
LuaValue |
lt(double rhs)
Less than: Perform numeric comparison with another value
of double type,
including metatag processing, and returning
LuaValue. |
LuaValue |
lt(long rhs)
Less than: Perform numeric comparison with another value
of int type,
including metatag processing, and returning
LuaValue. |
LuaValue |
lt(LuaValue rhs)
Less than: Perform numeric or string comparison with another value
of unknown type,
including metatag processing, and returning
LuaValue. |
boolean |
lteq_b(double rhs)
Less than or equals: Perform numeric comparison with another value
of double type,
including metatag processing,
and returning java boolean.
|
boolean |
lteq_b(long rhs)
Less than or equals: Perform numeric comparison with another value
of int type,
including metatag processing,
and returning java boolean.
|
boolean |
lteq_b(LuaValue rhs)
Less than or equals: Perform numeric or string comparison with another value
of unknown type, including metatag processing,
and returning java boolean.
|
LuaValue |
lteq(double rhs)
Less than or equals: Perform numeric comparison with another value
of double type,
including metatag processing, and returning
LuaValue. |
LuaValue |
lteq(long rhs)
Less than or equals: Perform numeric comparison with another value
of int type,
including metatag processing, and returning
LuaValue. |
LuaValue |
lteq(LuaValue rhs)
Less than or equals: Perform numeric or string comparison with another value
of unknown type,
including metatag processing, and returning
LuaValue. |
LuaValue |
mod(double rhs)
Modulo: Perform numeric modulo operation with another value
of double type without metatag processing
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.mod(LuaValue) must be used |
LuaValue |
mod(long rhs)
Modulo: Perform numeric modulo operation with another value
of int type without metatag processing
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.mod(LuaValue) must be used |
LuaValue |
mod(LuaValue rhs)
Modulo: Perform numeric modulo operation with another value
of unknown type,
including metatag processing.
|
LuaValue |
modFrom(double lhs)
|
LuaValue |
mul(double lhs)
|
LuaValue |
mul(long lhs)
|
LuaValue |
mul(LuaValue rhs)
Multiply: Perform numeric multiply operation with another value
of unknown type,
including metatag processing.
|
LuaValue |
neg()
Unary minus: return negative value
(-this) as defined by lua unary minus operator |
double |
optdouble(double defval)
Check that optional argument is a number or string convertible to number and return as double
|
int |
optint(int defval)
Check that optional argument is a number or string convertible to number and return as int
|
LuaInteger |
optinteger(LuaInteger defval)
Check that optional argument is a number or string convertible to number and return as
LuaInteger |
String |
optjstring(String defval)
Check that optional argument is a string or number and return as Java String
|
long |
optlong(long defval)
Check that optional argument is a number or string convertible to number and return as long
|
LuaNumber |
optnumber(LuaNumber defval)
Check that optional argument is a number or string convertible to number and return as
LuaNumber |
LuaString |
optstring(LuaString defval)
Check that optional argument is a string or number and return as
LuaString |
LuaValue |
pow(double rhs)
|
LuaValue |
pow(long rhs)
|
LuaValue |
pow(LuaValue rhs)
Raise to power: Raise this value to a power
including metatag processing.
|
LuaValue |
powWith(double lhs)
|
LuaValue |
powWith(long lhs)
|
boolean |
raweq(double val)
Equals: Perform direct equality comparison with a double value
without metatag processing.
|
boolean |
raweq(long val)
Equals: Perform direct equality comparison with a int value
without metatag processing.
|
boolean |
raweq(LuaValue val)
Equals: Perform direct equality comparison with another value
without metatag processing.
|
LuaValue |
shl(long lhs) |
LuaValue |
shl(LuaValue rhs) |
LuaValue |
shr(long lhs) |
LuaValue |
shr(LuaValue rhs) |
int |
strcmp(LuaString rhs)
Perform string comparison with another value
known to be a
LuaString
using string comparison based on byte values. |
LuaString |
strvalue()
|
LuaValue |
sub(double rhs)
|
LuaValue |
sub(long rhs)
|
LuaValue |
sub(LuaValue rhs)
Subtract: Perform numeric subtract operation with another value
of unknown type,
including metatag processing.
|
LuaValue |
subFrom(double lhs)
|
byte |
tobyte()
Convert to byte if numeric, or 0 if not.
|
char |
tochar()
Convert to char if numeric, or 0 if not.
|
double |
todouble()
Convert to double if numeric, or 0 if not.
|
float |
tofloat()
Convert to float if numeric, or 0 if not.
|
int |
toint()
Convert to int if numeric, or 0 if not.
|
String |
tojstring()
Convert to human readable String for any type.
|
long |
tolong()
Convert to long if numeric, or 0 if not.
|
LuaValue |
tonumber()
Conditionally convert to lua number without throwing errors.
|
short |
toshort()
Convert to short if numeric, or 0 if not.
|
LuaValue |
tostring()
Conditionally convert to lua string without throwing errors.
|
static LuaNumber |
valueOf(double d) |
checknumber, concat, concat, concatTo, concatTo, getmetatable, type, typenameadd, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, call, callmt, checkboolean, checkclosure, checkfunction, checkglobals, checkmetatag, checknotnil, checktable, checkthread, checkuserdata, checkuserdata, compareerror, compareerror, comparemt, concatmt, concatTo, eqmtcall, error, get, get, get, getfenv, gettable, getuservalue, illegal, inext, initupvalue1, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isnil, istable, isthread, isuserdata, isuserdata, jcall, jget, jset, len, lenerror, length, listOf, listOf, load, metatableOf, metatag, method, method, method, method, method, method, narg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optfunction, opttable, optthread, optuserdata, optuserdata, optvalue, or, presize, raweq, raweq, rawget, rawget, rawget, rawlen, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, setuservalue, strcmp, strongvalue, subargs, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOfargcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, dealias, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, typepublic static final LuaDouble NAN
public static final LuaDouble POSINF
public static final LuaDouble NEGINF
public static final String JSTR_NAN
public static final String JSTR_POSINF
public static LuaNumber valueOf(double d)
public boolean islong()
LuaValuethis is a number and is representable by java long
without rounding or truncationislong 在类中 LuaValuenumber
meaning derives from LuaNumber
or derives from LuaString and is convertible to a number,
and can be represented by long,
otherwise falseLuaValue.tonumber(),
LuaValue.checklong(),
LuaValue.optlong(long),
LuaValue.TNUMBERpublic boolean isinttype()
LuaValueisinttype 在类中 LuaValueLuaInteger,
otherwise falseLuaValue.isint(),
LuaValue.isnumber(),
LuaValue.tonumber(),
LuaValue.TNUMBERpublic boolean isint()
LuaValuethis is a number and is representable by java int
without rounding or truncationisint 在类中 LuaValuenumber
meaning derives from LuaNumber
or derives from LuaString and is convertible to a number,
and can be represented by int,
otherwise falseLuaValue.isinttype(),
LuaValue.islong(),
LuaValue.tonumber(),
LuaValue.checkint(),
LuaValue.optint(int),
LuaValue.TNUMBERpublic byte tobyte()
LuaValuetobyte 在类中 LuaValueLuaValue.toint(),
LuaValue.todouble(),
LuaValue.checknumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic char tochar()
LuaValuetochar 在类中 LuaValueLuaValue.toint(),
LuaValue.todouble(),
LuaValue.checknumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic double todouble()
LuaValuetodouble 在类中 LuaValueLuaValue.toint(),
LuaValue.tobyte(),
LuaValue.tochar(),
LuaValue.toshort(),
LuaValue.tolong(),
LuaValue.tofloat(),
LuaValue.optdouble(double),
LuaValue.checknumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic float tofloat()
LuaValuetofloat 在类中 LuaValueLuaValue.toint(),
LuaValue.todouble(),
LuaValue.checknumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic int toint()
LuaValuetoint 在类中 LuaValueLuaValue.tobyte(),
LuaValue.tochar(),
LuaValue.toshort(),
LuaValue.tolong(),
LuaValue.tofloat(),
LuaValue.todouble(),
LuaValue.optint(int),
LuaValue.checknumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic long tolong()
LuaValuetolong 在类中 LuaValueLuaValue.isint(),
LuaValue.isinttype(),
LuaValue.toint(),
LuaValue.todouble(),
LuaValue.optlong(long),
LuaValue.checknumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic short toshort()
LuaValuetoshort 在类中 LuaValueLuaValue.toint(),
LuaValue.todouble(),
LuaValue.checknumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic double optdouble(double defval)
LuaValueoptdouble 在类中 LuaValuedefval - double to return if this is nil or nonethis cast to double if numeric,
defval if nil or none,
throws LuaError otherwiseLuaValue.optint(int),
LuaValue.optinteger(LuaInteger),
LuaValue.checkdouble(),
LuaValue.todouble(),
LuaValue.tonumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic int optint(int defval)
LuaValueoptint 在类中 LuaValuedefval - int to return if this is nil or nonethis cast to int if numeric,
defval if nil or none,
throws LuaError otherwiseLuaValue.optdouble(double),
LuaValue.optlong(long),
LuaValue.optinteger(LuaInteger),
LuaValue.checkint(),
LuaValue.toint(),
LuaValue.tonumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic LuaInteger optinteger(LuaInteger defval)
LuaValueLuaIntegeroptinteger 在类中 LuaValuedefval - LuaInteger to return if this is nil or nonethis converted and wrapped in LuaInteger if numeric,
defval if nil or none,
throws LuaError otherwiseLuaValue.optdouble(double),
LuaValue.optint(int),
LuaValue.checkint(),
LuaValue.toint(),
LuaValue.tonumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic long optlong(long defval)
LuaValueoptlong 在类中 LuaValuedefval - long to return if this is nil or nonethis cast to long if numeric,
defval if nil or none,
throws LuaError otherwiseLuaValue.optdouble(double),
LuaValue.optint(int),
LuaValue.checkint(),
LuaValue.toint(),
LuaValue.tonumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic LuaInteger checkinteger()
LuaValueLuaError if not numeric
Values that are LuaNumber will be cast to int and may lose precision.
Values that are LuaString that can be converted to a number will be converted,
then cast to int, so may also lose precision.
checkinteger 在类中 LuaValueLuaInteger if numericLuaValue.checkint(),
LuaValue.checklong(),
LuaValue.checkdouble(),
LuaValue.optinteger(LuaInteger),
LuaValue.TNUMBERpublic LuaValue neg()
LuaValue(-this) as defined by lua unary minus operatorneg 在类中 LuaValueLuaBoolean if boolean or nil,
numeric inverse as LuaNumber if numeric,
or metatag processing result if LuaValue.UNM metatag is definedpublic LuaValue eq(LuaValue val)
LuaValueLuaValue.EQ.eq 在类中 LuaValueval - The value to compare with.LuaValue.TRUE if values are comparable and (this == rhs),
LuaValue.FALSE if comparable but not equal,
LuaValue if metatag processing occurs.LuaValue.eq_b(LuaValue),
LuaValue.raweq(LuaValue),
LuaValue.neq(LuaValue),
LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue),
LuaValue.EQpublic boolean eq_b(LuaValue val)
LuaValueLuaValue.EQ,
and return java booleaneq_b 在类中 LuaValueval - The value to compare with.(this == rhs),
false if comparable but not equal,
result converted to java boolean if metatag processing occurs.LuaValue.eq(LuaValue),
LuaValue.raweq(LuaValue),
LuaValue.neq_b(LuaValue),
LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue),
LuaValue.EQpublic boolean raweq(LuaValue val)
LuaValueraweq 在类中 LuaValueval - The value to compare with.(this == rhs), false otherwiseLuaValue.eq(LuaValue),
LuaValue.raweq(LuaUserdata),
LuaValue.raweq(LuaString),
LuaValue.raweq(double),
#raweq(int),
LuaValue.EQpublic boolean raweq(double val)
LuaValuepublic boolean raweq(long val)
LuaValuepublic LuaValue add(LuaValue rhs)
LuaValue
Each operand must derive from LuaNumber
or derive from LuaString and be convertible to a number
add 在类中 LuaValuerhs - The right-hand-side value to perform the add with(this + rhs) if both are numeric,
or LuaValue if metatag processing occursLuaValue.arithmt(LuaValue, LuaValue)public LuaValue add(double lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
add 在类中 LuaValuelhs - The right-hand-side value to perform the add with(this + rhs) if this is numericLuaValue.add(LuaValue)public LuaValue sub(LuaValue rhs)
LuaValue
Each operand must derive from LuaNumber
or derive from LuaString and be convertible to a number
sub 在类中 LuaValuerhs - The right-hand-side value to perform the subtract with(this - rhs) if both are numeric,
or LuaValue if metatag processing occursLuaValue.arithmt(LuaValue, LuaValue)public LuaValue sub(double rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
sub 在类中 LuaValuerhs - The right-hand-side value to perform the subtract with(this - rhs) if this is numericLuaValue.sub(LuaValue)public LuaValue sub(long rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
sub 在类中 LuaValuerhs - The right-hand-side value to perform the subtract with(this - rhs) if this is numericLuaValue.sub(LuaValue)public LuaValue subFrom(double lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
subFrom 在类中 LuaValuelhs - The left-hand-side value from which to perform the subtraction(lhs - this) if this is numericLuaValue.sub(LuaValue),
LuaValue.sub(double),
#sub(int)public LuaValue mul(LuaValue rhs)
LuaValue
Each operand must derive from LuaNumber
or derive from LuaString and be convertible to a number
mul 在类中 LuaValuerhs - The right-hand-side value to perform the multiply with(this * rhs) if both are numeric,
or LuaValue if metatag processing occursLuaValue.arithmt(LuaValue, LuaValue)public LuaValue mul(double lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
mul 在类中 LuaValuelhs - The right-hand-side value to perform the multiply with(this * rhs) if this is numericLuaValue.mul(LuaValue)public LuaValue mul(long lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
mul 在类中 LuaValuelhs - The right-hand-side value to perform the multiply with(this * rhs) if this is numericLuaValue.mul(LuaValue)public LuaValue pow(LuaValue rhs)
LuaValue
Each operand must derive from LuaNumber
or derive from LuaString and be convertible to a number
pow 在类中 LuaValuerhs - The power to raise this value to(this ^ rhs) if both are numeric,
or LuaValue if metatag processing occursLuaValue.arithmt(LuaValue, LuaValue)public LuaValue pow(double rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
pow 在类中 LuaValuerhs - The power to raise this value to(this ^ rhs) if this is numericLuaValue.pow(LuaValue)public LuaValue pow(long rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
pow 在类中 LuaValuerhs - The power to raise this value to(this ^ rhs) if this is numericLuaValue.pow(LuaValue)public LuaValue powWith(double lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
powWith 在类中 LuaValuelhs - The left-hand-side value which will be raised to this power(lhs ^ this) if this is numericLuaValue.pow(LuaValue),
LuaValue.pow(double),
#pow(int)public LuaValue powWith(long lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
powWith 在类中 LuaValuelhs - The left-hand-side value which will be raised to this power(lhs ^ this) if this is numericLuaValue.pow(LuaValue),
LuaValue.pow(double),
#pow(int)public LuaValue div(LuaValue rhs)
LuaValue
Each operand must derive from LuaNumber
or derive from LuaString and be convertible to a number
div 在类中 LuaValuerhs - The right-hand-side value to perform the divulo with(this / rhs) if both are numeric,
or LuaValue if metatag processing occursLuaValue.arithmt(LuaValue, LuaValue)public LuaValue div(double rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.div(LuaValue) must be used
div 在类中 LuaValuerhs - The right-hand-side value to perform the divulo with(this / rhs) if this is numericLuaValue.div(LuaValue)public LuaValue div(long rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.div(LuaValue) must be used
div 在类中 LuaValuerhs - The right-hand-side value to perform the divulo with(this / rhs) if this is numericLuaValue.div(LuaValue)public LuaValue divInto(double lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
divInto 在类中 LuaValuelhs - The left-hand-side value which will be divided by this(lhs / this) if this is numericLuaValue.div(LuaValue),
LuaValue.div(double),
#div(int)public LuaValue mod(LuaValue rhs)
LuaValue
Each operand must derive from LuaNumber
or derive from LuaString and be convertible to a number
mod 在类中 LuaValuerhs - The right-hand-side value to perform the modulo with(this % rhs) if both are numeric,
or LuaValue if metatag processing occursLuaValue.arithmt(LuaValue, LuaValue)public LuaValue mod(double rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.mod(LuaValue) must be used
mod 在类中 LuaValuerhs - The right-hand-side value to perform the modulo with(this % rhs) if this is numericLuaValue.mod(LuaValue)public LuaValue mod(long rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.mod(LuaValue) must be used
mod 在类中 LuaValuerhs - The right-hand-side value to perform the modulo with(this % rhs) if this is numericLuaValue.mod(LuaValue)public LuaValue modFrom(double lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
modFrom 在类中 LuaValuelhs - The left-hand-side value which will be modulo'ed by this(lhs % this) if this is numericLuaValue.mod(LuaValue),
LuaValue.mod(double),
#mod(int)public static LuaValue ddiv(double lhs, double rhs)
LuaValue result.lhs - Left-hand-side of the division.rhs - Right-hand-side of the division.LuaValue for the result of the division,
taking into account positive and negiative infinity, and Nanddiv_d(double, double)public static double ddiv_d(double lhs,
double rhs)
lhs - Left-hand-side of the division.rhs - Right-hand-side of the division.ddiv(double, double)public static LuaValue dmod(double lhs, double rhs)
LuaValue result.lhs - Left-hand-side of the modulo.rhs - Right-hand-side of the modulo.LuaValue for the result of the modulo,
using lua's rules for modulodmod_d(double, double)public static double dmod_d(double lhs,
double rhs)
lhs - Left-hand-side of the modulo.rhs - Right-hand-side of the modulo.dmod(double, double)public LuaValue lt(LuaValue rhs)
LuaValueLuaValue.
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
lt 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this < rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue lt(double rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
lt 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this < rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue lt(long rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
lt 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this < rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occurs#gteq_b(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean lt_b(LuaValue rhs)
LuaValue
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
lt_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this < rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public boolean lt_b(long rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
lt_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this < rhs), false if not,
and boolean interpreation of result if metatag processing occurs.#gteq(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean lt_b(double rhs)
LuaValue
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
lt_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this < rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue lteq(LuaValue rhs)
LuaValueLuaValue.
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
lteq 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this <= rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue lteq(double rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
lteq 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this <= rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue lteq(long rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
lteq 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this <= rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occurs#gteq_b(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean lteq_b(LuaValue rhs)
LuaValue
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
lteq_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this <= rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public boolean lteq_b(long rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
lteq_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this <= rhs), false if not,
and boolean interpreation of result if metatag processing occurs.#gteq(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean lteq_b(double rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
lteq_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this <= rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gt(LuaValue rhs)
LuaValueLuaValue.
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
gt 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this > rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gt(double rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
gt 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this > rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gt(long rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
gt 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this > rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occurs#gteq_b(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean gt_b(LuaValue rhs)
LuaValue
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
gt_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this > rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public boolean gt_b(long rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
gt_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this > rhs), false if not,
and boolean interpreation of result if metatag processing occurs.#gteq(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean gt_b(double rhs)
LuaValue
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
gt_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this > rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gteq(LuaValue rhs)
LuaValueLuaValue.
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
gteq 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this >= rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gteq(double rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
gteq 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this >= rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gteq(long rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
gteq 在类中 LuaValuerhs - The right-hand-side value to perform the comparison withLuaValue.TRUE if (this >= rhs), LuaValue.FALSE if not,
or LuaValue if metatag processing occurs#gteq_b(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean gteq_b(LuaValue rhs)
LuaValue
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
gteq_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this >= rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(LuaValue),
LuaValue.comparemt(LuaValue, LuaValue)public boolean gteq_b(long rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
gteq_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this >= rhs), false if not,
and boolean interpreation of result if metatag processing occurs.#gteq(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean gteq_b(double rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
gteq_b 在类中 LuaValuerhs - The right-hand-side value to perform the comparison with(this >= rhs), false if not,
and boolean interpreation of result if metatag processing occurs.LuaValue.gteq(double),
LuaValue.comparemt(LuaValue, LuaValue)public String tojstring()
LuaValuetojstring 在类中 LuaValueLuaValue.tostring(),
LuaValue.optjstring(String),
LuaValue.checkjstring(),
LuaValue.isstring(),
LuaValue.TSTRINGpublic LuaString optstring(LuaString defval)
LuaValueLuaStringoptstring 在类中 LuaValuedefval - LuaString to return if this is nil or nonethis converted to LuaString if a string or number,
defval if nil or none,
throws LuaError if some other typeLuaValue.tojstring(),
LuaValue.optjstring(String),
LuaValue.checkstring(),
LuaValue.toString(),
LuaValue.TSTRINGpublic LuaValue tostring()
LuaValue
In lua all numbers are strings, so this function will return
the LuaValue this if it is a string or number,
and LuaValue.NIL for all other cases.
This allows values to be tested for their "string-ness" without the penalty of throwing exceptions.
tostring 在类中 LuaValuethis if it is a LuaString or LuaNumber,
otherwise LuaValue.NILLuaValue.tonumber(),
LuaValue.tojstring(),
LuaValue.optstring(LuaString),
LuaValue.checkstring(),
LuaValue.toString()public String optjstring(String defval)
LuaValueoptjstring 在类中 LuaValuedefval - LuaString to return if this is nil or nonethis converted to String if a string or number,
defval if nil or none,
throws LuaError if some other typeLuaValue.tojstring(),
LuaValue.optstring(LuaString),
LuaValue.checkjstring(),
LuaValue.toString(),
LuaValue.TSTRINGpublic LuaNumber optnumber(LuaNumber defval)
LuaValueLuaNumberoptnumber 在类中 LuaNumberdefval - LuaNumber to return if this is nil or nonethis cast to LuaNumber if numeric,
defval if nil or none,
throws LuaError otherwiseLuaValue.optdouble(double),
LuaValue.optlong(long),
LuaValue.optint(int),
LuaValue.checkint(),
LuaValue.toint(),
LuaValue.tonumber(),
LuaValue.isnumber(),
LuaValue.TNUMBERpublic boolean isnumber()
LuaValuethis is a numberisnumber 在类中 LuaNumbernumber,
meaning derives from LuaNumber
or derives from LuaString and is convertible to a number,
otherwise falseLuaValue.tonumber(),
LuaValue.checknumber(),
LuaValue.optnumber(LuaNumber),
LuaValue.TNUMBERpublic boolean isstring()
LuaValuethis is a stringisstring 在类中 LuaNumberstring,
meaning derives from LuaString or LuaNumber,
otherwise falseLuaValue.tostring(),
LuaValue.checkstring(),
LuaValue.optstring(LuaString),
LuaValue.TSTRINGpublic LuaValue tonumber()
LuaValue
In lua all numbers are strings, but not all strings are numbers.
This function will return
the LuaValue this if it is a number
or a string convertible to a number,
and LuaValue.NIL for all other cases.
This allows values to be tested for their "numeric-ness" without the penalty of throwing exceptions, nor the cost of converting the type and creating storage for it.
tonumber 在类中 LuaNumberthis if it is a LuaNumber
or LuaString that can be converted to a number,
otherwise LuaValue.NILLuaValue.tostring(),
LuaValue.optnumber(LuaNumber),
LuaValue.checknumber(),
LuaValue.toint(),
LuaValue.todouble()public int checkint()
LuaValueLuaError if not numeric
Values that are LuaNumber will be cast to int and may lose precision.
Values that are LuaString that can be converted to a number will be converted,
then cast to int, so may also lose precision.
checkint 在类中 LuaValueLuaValue.checkinteger(),
LuaValue.checklong(),
LuaValue.checkdouble(),
LuaValue.optint(int),
LuaValue.TNUMBERpublic long checklong()
LuaValueLuaError if not numeric
Values that are LuaNumber will be cast to long and may lose precision.
Values that are LuaString that can be converted to a number will be converted,
then cast to long, so may also lose precision.
checklong 在类中 LuaValueLuaValue.checkint(),
LuaValue.checkinteger(),
LuaValue.checkdouble(),
LuaValue.optlong(long),
LuaValue.TNUMBERpublic LuaNumber checknumber()
LuaValueLuaError
Values that are LuaString that can be converted to a number will be converted and returned.
checknumber 在类中 LuaNumberLuaNumber if numericLuaValue.checkint(),
LuaValue.checkinteger(),
LuaValue.checkdouble(),
LuaValue.checklong(),
LuaValue.optnumber(LuaNumber),
LuaValue.TNUMBERpublic double checkdouble()
LuaValueLuaError if not numeric
Values that are LuaNumber and values that are LuaString
that can be converted to a number will be converted to double.
checkdouble 在类中 LuaValueLuaValue.checkint(),
LuaValue.checkinteger(),
LuaValue.checklong(),
LuaValue.optdouble(double),
LuaValue.TNUMBERpublic String checkjstring()
LuaValueThe string representations here will roughly match what is produced by the C lua distribution, however hash codes have no relationship, and there may be differences in number formatting.
checkjstring 在类中 LuaValueLuaValue.checkstring(),
LuaValue.optjstring(String),
LuaValue.tojstring(),
LuaValue.isstring(),
LuaValue.TSTRINGpublic LuaString checkstring()
LuaValueLuaError if it is not.
In lua all numbers are strings, so this will succeed for
anything that derives from LuaString or LuaNumber.
Numbers will be converted to LuaString.
checkstring 在类中 LuaValueLuaString representation of the value if it is a LuaString or LuaNumberLuaValue.checkjstring(),
LuaValue.optstring(LuaString),
LuaValue.tostring(),
LuaValue.isstring(),
LuaValue.TSTRINGpublic boolean isvalidkey()
LuaValueisvalidkey 在类中 LuaValueLuaValue.isnil(),
LuaValue.isinttype()Copyright © 2020. All rights reserved.