|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.luaj.vm2.Varargs
org.luaj.vm2.LuaValue
org.luaj.vm2.LuaNumber
org.luaj.vm2.LuaInteger
public class LuaInteger
Extension of LuaNumber which can hold a Java int 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 policies regarding pooling of instances are
encapsulated.
There are no API's specific to LuaInteger that are useful beyond what is already
exposed in LuaValue.
LuaValue,
LuaNumber,
LuaDouble,
LuaValue.valueOf(int),
LuaValue.valueOf(double)| Field Summary | |
|---|---|
int |
v
The value being held by this instance. |
| Fields inherited from class org.luaj.vm2.LuaNumber |
|---|
s_metatable |
| Fields inherited from class org.luaj.vm2.LuaValue |
|---|
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO |
| Method Summary | |
|---|---|
LuaValue |
add(double lhs)
Add: Perform numeric add operation with another value of double type with metatag processing |
LuaValue |
add(int lhs)
Add: Perform numeric add operation with another value of int type with metatag processing |
LuaValue |
add(LuaValue rhs)
Add: Perform numeric add operation with another value including metatag processing. |
double |
checkdouble()
Check that the value is numeric and return the value as a double, or throw LuaError if not numeric |
int |
checkint()
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric |
LuaInteger |
checkinteger()
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric |
java.lang.String |
checkjstring()
Convert this value to a Java String. |
long |
checklong()
Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric |
LuaString |
checkstring()
Check that this is a lua string, or throw LuaError if it is not. |
LuaValue |
div(double rhs)
Divide: Perform numeric divide operation by another value of double type without metatag processing |
LuaValue |
div(int rhs)
Divide: Perform numeric divide operation by another value of int type without metatag processing |
LuaValue |
div(LuaValue rhs)
Divide: Perform numeric divide operation by another value of unknown type, including metatag processing. |
LuaValue |
divInto(double lhs)
Reverse-divide: Perform numeric divide operation into another value with metatag processing |
boolean |
eq_b(LuaValue val)
Equals: Perform equality comparison with another value including metatag processing using EQ,
and return java boolean |
LuaValue |
eq(LuaValue val)
Equals: Perform equality comparison with another value including metatag processing using EQ. |
boolean |
equals(java.lang.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(int 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(int 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(int 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(int 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()
|
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 |
boolean |
islong()
Check if this is a number and is representable by java long
without rounding or truncation |
boolean |
isstring()
Check if this is a string |
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(int 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(int 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(int 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(int 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 |
LuaValue |
mod(int rhs)
Modulo: Perform numeric modulo operation with another value of int type without metatag processing |
LuaValue |
mod(LuaValue rhs)
Modulo: Perform numeric modulo operation with another value of unknown type, including metatag processing. |
LuaValue |
modFrom(double lhs)
Reverse-modulo: Perform numeric modulo operation from another value with metatag processing |
LuaValue |
mul(double lhs)
Multiply: Perform numeric multiply operation with another value of double type with metatag processing |
LuaValue |
mul(int lhs)
Multiply: Perform numeric multiply operation with another value of int type with metatag processing |
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 |
java.lang.String |
optjstring(java.lang.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 |
LuaString |
optstring(LuaString defval)
Check that optional argument is a string or number and return as LuaString |
LuaValue |
pow(double rhs)
Raise to power: Raise this value to a power of double type with metatag processing |
LuaValue |
pow(int rhs)
Raise to power: Raise this value to a power of int type with metatag processing |
LuaValue |
pow(LuaValue rhs)
Raise to power: Raise this value to a power including metatag processing. |
LuaValue |
powWith(double lhs)
Reverse-raise to power: Raise another value of double type to this power with metatag processing |
LuaValue |
powWith(int lhs)
Reverse-raise to power: Raise another value of double type to this power with metatag processing |
boolean |
raweq(double val)
Equals: Perform direct equality comparison with a double value without metatag processing. |
boolean |
raweq(int 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. |
int |
strcmp(LuaString rhs)
Perform string comparison with another value known to be a LuaString
using string comparison based on byte values. |
LuaString |
strvalue()
Convert this value to a string if it is a LuaString or LuaNumber,
or throw a LuaError if it is not |
LuaValue |
sub(double rhs)
Subtract: Perform numeric subtract operation with another value of double type with metatag processing |
LuaValue |
sub(int rhs)
Subtract: Perform numeric subtract operation with another value of int type with metatag processing |
LuaValue |
sub(LuaValue rhs)
Subtract: Perform numeric subtract operation with another value of unknown type, including metatag processing. |
LuaValue |
subFrom(double lhs)
Reverse-subtract: Perform numeric subtract operation from an int value with metatag processing |
LuaValue |
subFrom(int lhs)
Reverse-subtract: Perform numeric subtract operation from a double value without metatag processing |
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. |
java.lang.String |
tojstring()
Convert to human readable String for any type. |
long |
tolong()
Convert to long if numeric, or 0 if not. |
short |
toshort()
Convert to short if numeric, or 0 if not. |
LuaValue |
tostring()
Conditionally convert to lua string without throwing errors. |
static LuaInteger |
valueOf(int i)
|
static LuaNumber |
valueOf(long l)
Return a LuaNumber that represents the value provided |
| Methods inherited from class org.luaj.vm2.LuaNumber |
|---|
checknumber, checknumber, concat, concat, concatTo, concatTo, getmetatable, isnumber, optnumber, tonumber, type, typename |
| Methods inherited from class org.luaj.vm2.Varargs |
|---|
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, 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, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final int v
| Method Detail |
|---|
public static LuaInteger valueOf(int i)
public static LuaNumber valueOf(long l)
l - long value to represent.
LuaValue.valueOf(int),
LuaValue.valueOf(double)public boolean isint()
LuaValuethis is a number and is representable by java int
without rounding or truncation
isint in class 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 boolean isinttype()
LuaValuethis is a LuaInteger
No attempt to convert from string will be made by this call.
isinttype in class LuaValueLuaInteger,
otherwise falseLuaValue.isint(),
LuaValue.isnumber(),
LuaValue.tonumber(),
LuaValue.TNUMBERpublic boolean islong()
LuaValuethis is a number and is representable by java long
without rounding or truncation
islong in class 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 byte tobyte()
LuaValue
tobyte in class LuaValueLuaValue.toint(),
LuaValue.todouble(),
#optbyte(byte),
LuaValue.checknumber(),
LuaValue.isnumber(),
TNUMBERpublic char tochar()
LuaValue
tochar in class LuaValueLuaValue.toint(),
LuaValue.todouble(),
#optchar(char),
LuaValue.checknumber(),
LuaValue.isnumber(),
TNUMBERpublic double todouble()
LuaValue
todouble in class LuaValueLuaValue.toint(),
LuaValue.tobyte(),
LuaValue.tochar(),
LuaValue.toshort(),
LuaValue.tolong(),
LuaValue.tofloat(),
LuaValue.optdouble(double),
LuaValue.checknumber(),
LuaValue.isnumber(),
TNUMBERpublic float tofloat()
LuaValue
tofloat in class LuaValueLuaValue.toint(),
LuaValue.todouble(),
#optfloat(float),
LuaValue.checknumber(),
LuaValue.isnumber(),
TNUMBERpublic int toint()
LuaValue
toint in class LuaValueLuaValue.tobyte(),
LuaValue.tochar(),
LuaValue.toshort(),
LuaValue.tolong(),
LuaValue.tofloat(),
LuaValue.todouble(),
LuaValue.optint(int),
LuaValue.checknumber(),
LuaValue.isnumber(),
TNUMBERpublic long tolong()
LuaValue
tolong in class LuaValueLuaValue.isint(),
LuaValue.isinttype(),
LuaValue.toint(),
LuaValue.todouble(),
LuaValue.optlong(long),
LuaValue.checknumber(),
LuaValue.isnumber(),
TNUMBERpublic short toshort()
LuaValue
toshort in class LuaValueLuaValue.toint(),
LuaValue.todouble(),
#optshort(short),
LuaValue.checknumber(),
LuaValue.isnumber(),
TNUMBERpublic double optdouble(double defval)
LuaValue
optdouble in class LuaValuedefval - double to return if this is nil or none
this 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)
LuaValue
optint in class LuaValuedefval - int to return if this is nil or none
this 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)
LuaValueLuaInteger
optinteger in class LuaValuedefval - LuaInteger to return if this is nil or none
this 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)
LuaValue
optlong in class LuaValuedefval - long to return if this is nil or none
this 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 java.lang.String tojstring()
LuaValue
tojstring in class LuaValueLuaValue.tostring(),
LuaValue.optjstring(String),
LuaValue.checkjstring(),
LuaValue.isstring(),
TSTRINGpublic LuaString strvalue()
LuaValueLuaString or LuaNumber,
or throw a LuaError if it is not
strvalue in class LuaValueLuaString corresponding to the value if a string or numberpublic LuaString optstring(LuaString defval)
LuaValueLuaString
optstring in class LuaValuedefval - LuaString to return if this is nil or none
this 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 NIL for all other cases.
This allows values to be tested for their "string-ness" without the penalty of throwing exceptions.
tostring in class LuaValuethis if it is a LuaString or LuaNumber,
otherwise NILLuaValue.tonumber(),
LuaValue.tojstring(),
LuaValue.optstring(LuaString),
LuaValue.checkstring(),
LuaValue.toString()public java.lang.String optjstring(java.lang.String defval)
LuaValue
optjstring in class LuaValuedefval - LuaString to return if this is nil or none
this 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 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 in class LuaValueLuaInteger if numericLuaValue.checkint(),
LuaValue.checklong(),
LuaValue.checkdouble(),
LuaValue.optinteger(LuaInteger),
LuaValue.TNUMBERpublic boolean isstring()
LuaValuethis is a string
isstring in class LuaNumberstring,
meaning derives from LuaString or LuaNumber,
otherwise falseLuaValue.tostring(),
LuaValue.checkstring(),
LuaValue.optstring(LuaString),
LuaValue.TSTRINGpublic int hashCode()
hashCode in class java.lang.Objectpublic LuaValue neg()
LuaValue(-this) as defined by lua unary minus operator
neg in class LuaValueLuaBoolean if boolean or nil,
numeric inverse as if numeric,
or metatag processing result if UNM metatag is definedpublic boolean equals(java.lang.Object o)
equals in class LuaValuepublic LuaValue eq(LuaValue val)
LuaValueEQ.
eq in class LuaValueval - The value to compare with.
TRUE if values are comparable and (this == rhs),
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)
LuaValueEQ,
and return java boolean
eq_b in class 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)
LuaValue
raweq in class LuaValueval - The value to compare with.
(this == rhs), false otherwiseLuaValue.eq(LuaValue),
LuaValue.raweq(LuaUserdata),
LuaValue.raweq(LuaString),
LuaValue.raweq(double),
LuaValue.raweq(int),
LuaValue.EQpublic boolean raweq(double val)
LuaValue
raweq in class LuaValueval - The double value to compare with.
this is a LuaNumber
whose value equals val,
otherwise falsepublic boolean raweq(int val)
LuaValue
raweq in class LuaValueval - The double value to compare with.
this is a LuaNumber
whose value equals val,
otherwise falsepublic LuaValue add(LuaValue rhs)
LuaValue
Each operand must derive from LuaNumber
or derive from LuaString and be convertible to a number
add in class 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 in class LuaValuelhs - The right-hand-side value to perform the add with
(this + rhs) if this is numericLuaValue.add(LuaValue)public LuaValue add(int lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
add in class 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 in class 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 in class LuaValuerhs - The right-hand-side value to perform the subtract with
(this - rhs) if this is numericLuaValue.sub(LuaValue)public LuaValue sub(int rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
sub in class 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 in class LuaValuelhs - The left-hand-side value from which to perform the subtraction
(lhs - this) if this is numericLuaValue.sub(LuaValue),
LuaValue.sub(double),
LuaValue.sub(int)public LuaValue subFrom(int lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
For metatag processing LuaValue.sub(LuaValue) must be used
subFrom in class LuaValuelhs - The left-hand-side value from which to perform the subtraction
(lhs - this) if this is numericLuaValue.sub(LuaValue),
LuaValue.sub(double),
LuaValue.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 in class 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 in class LuaValuelhs - The right-hand-side value to perform the multiply with
(this * rhs) if this is numericLuaValue.mul(LuaValue)public LuaValue mul(int lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
mul in class 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 in class 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 in class LuaValuerhs - The power to raise this value to
(this ^ rhs) if this is numericLuaValue.pow(LuaValue)public LuaValue pow(int rhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
pow in class 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 in class LuaValuelhs - The left-hand-side value which will be raised to this power
(lhs ^ this) if this is numericLuaValue.pow(LuaValue),
LuaValue.pow(double),
LuaValue.pow(int)public LuaValue powWith(int lhs)
LuaValue
this must derive from LuaNumber
or derive from LuaString and be convertible to a number
powWith in class LuaValuelhs - The left-hand-side value which will be raised to this power
(lhs ^ this) if this is numericLuaValue.pow(LuaValue),
LuaValue.pow(double),
LuaValue.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 in class 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 in class LuaValuerhs - The right-hand-side value to perform the divulo with
(this / rhs) if this is numericLuaValue.div(LuaValue)public LuaValue div(int 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 in class 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 in class LuaValuelhs - The left-hand-side value which will be divided by this
(lhs / this) if this is numericLuaValue.div(LuaValue),
LuaValue.div(double),
LuaValue.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 in class 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 in class LuaValuerhs - The right-hand-side value to perform the modulo with
(this % rhs) if this is numericLuaValue.mod(LuaValue)public LuaValue mod(int 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 in class 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 in class LuaValuelhs - The left-hand-side value which will be modulo'ed by this
(lhs % this) if this is numericLuaValue.mod(LuaValue),
LuaValue.mod(double),
LuaValue.mod(int)public LuaValue lt(LuaValue rhs)
LuaValueLuaValue.
To be comparable, both operands must derive from LuaString
or both must derive from LuaNumber.
lt in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this < rhs), 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 in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this < rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue lt(int rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
lt in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this < rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.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 in class 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(int rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
lt_b in class 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(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 in class 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 in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this <= rhs), 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 in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this <= rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue lteq(int rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
lteq in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this <= rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.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 in class 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(int rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
lteq_b in class 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(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean lteq_b(double rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
lteq_b in class 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 in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this > rhs), 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 in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this > rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gt(int rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
gt in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this > rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.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 in class 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(int rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
gt_b in class 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(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 in class 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 in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this >= rhs), 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 in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this >= rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.gteq_b(double),
LuaValue.comparemt(LuaValue, LuaValue)public LuaValue gteq(int rhs)
LuaValueLuaValue.
To be comparable, this must derive from LuaNumber.
gteq in class LuaValuerhs - The right-hand-side value to perform the comparison with
TRUE if (this >= rhs), FALSE if not,
or LuaValue if metatag processing occursLuaValue.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 in class 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(int rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
gteq_b in class 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(int),
LuaValue.comparemt(LuaValue, LuaValue)public boolean gteq_b(double rhs)
LuaValue
To be comparable, this must derive from LuaNumber.
gteq_b in class 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 int strcmp(LuaString rhs)
LuaValueLuaString
using string comparison based on byte values.
Only strings can be compared, meaning
each operand must derive from LuaString.
strcmp in class LuaValuerhs - The right-hand-side value to perform the comparison withpublic 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 in class 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 in class LuaValueLuaValue.checkint(),
LuaValue.checkinteger(),
LuaValue.checkdouble(),
LuaValue.optlong(long),
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 in class LuaValueLuaValue.checkint(),
LuaValue.checkinteger(),
LuaValue.checklong(),
LuaValue.optdouble(double),
LuaValue.TNUMBERpublic java.lang.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 in class 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 in class LuaValueLuaString representation of the value if it is a LuaString or LuaNumberLuaValue.checkjstring(),
LuaValue.optstring(LuaString),
LuaValue.tostring(),
LuaValue.isstring(),
LuaValue.TSTRING
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||