Class LuaInteger
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.prineside.luaj.LuaValue
LuaValue.NillableSerializer, LuaValue.None -
Field Summary
FieldsFields inherited from class com.prineside.luaj.LuaNumber
s_metatableFields inherited from class com.prineside.luaj.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, ENV, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILLABLE_SERIALIZER, 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
Modifier and TypeMethodDescriptionadd(double lhs) Add: Perform numeric add operation with another value of double type with metatag processingadd(int lhs) Add: Perform numeric add operation with another value of int type with metatag processingAdd: Perform numeric add operation with another value including metatag processing.doubleCheck that the value is numeric and return the value as a double, or throwLuaErrorif not numericintcheckint()Check that the value is numeric, and convert and cast value to int, or throwLuaErrorif not numericCheck that the value is numeric, and convert and cast value to int, or throwLuaErrorif not numericConvert this value to a Java String.longCheck that the value is numeric, and convert and cast value to long, or throwLuaErrorif not numericCheck that this is a lua string, or throwLuaErrorif it is not.div(double rhs) Divide: Perform numeric divide operation by another value of double type without metatag processingdiv(int rhs) Divide: Perform numeric divide operation by another value of int type without metatag processingDivide: Perform numeric divide operation by another value of unknown type, including metatag processing.divInto(double lhs) Reverse-divide: Perform numeric divide operation into another value with metatag processingEquals: Perform equality comparison with another value including metatag processing usingLuaValue.EQ.booleanEquals: Perform equality comparison with another value including metatag processing usingLuaValue.EQ, and return java booleanbooleangt(double rhs) Greater than: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.gt(int rhs) Greater than: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.Greater than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.booleangt_b(double rhs) Greater than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.booleangt_b(int rhs) Greater than: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.booleanGreater than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.gteq(double rhs) Greater than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.gteq(int rhs) Greater than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.Greater than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.booleangteq_b(double rhs) Greater than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returning java boolean.booleangteq_b(int rhs) Greater than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.booleanGreater than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.inthashCode()static inthashCode(int x) booleanisint()Check ifthisis anumberand is representable by java int without rounding or truncationbooleanCheck ifthisis aLuaIntegerbooleanislong()Check ifthisis anumberand is representable by java long without rounding or truncationbooleanisstring()Check ifthisis astringlt(double rhs) Less than: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.lt(int rhs) Less than: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.Less than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.booleanlt_b(double rhs) Less than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.booleanlt_b(int rhs) Less than: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.booleanLess than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.lteq(double rhs) Less than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.lteq(int rhs) Less than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.Less than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.booleanlteq_b(double rhs) Less than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returning java boolean.booleanlteq_b(int rhs) Less than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.booleanLess than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.mod(double rhs) Modulo: Perform numeric modulo operation with another value of double type without metatag processingmod(int rhs) Modulo: Perform numeric modulo operation with another value of int type without metatag processingModulo: Perform numeric modulo operation with another value of unknown type, including metatag processing.modFrom(double lhs) Reverse-modulo: Perform numeric modulo operation from another value with metatag processingmul(double lhs) Multiply: Perform numeric multiply operation with another value of double type with metatag processingmul(int lhs) Multiply: Perform numeric multiply operation with another value of int type with metatag processingMultiply: Perform numeric multiply operation with another value of unknown type, including metatag processing.neg()Unary minus: return negative value(-this)as defined by lua unary minus operatordoubleoptdouble(double defval) Check that optional argument is a number or string convertible to number and return as doubleintoptint(int defval) Check that optional argument is a number or string convertible to number and return as intoptinteger(LuaInteger defval) Check that optional argument is a number or string convertible to number and return asLuaIntegeroptjstring(String defval) Check that optional argument is a string or number and return as Java Stringlongoptlong(long defval) Check that optional argument is a number or string convertible to number and return as longCheck that optional argument is a string or number and return asLuaStringpow(double rhs) Raise to power: Raise this value to a power of double type with metatag processingpow(int rhs) Raise to power: Raise this value to a power of int type with metatag processingRaise to power: Raise this value to a power including metatag processing.powWith(double lhs) Reverse-raise to power: Raise another value of double type to this power with metatag processingpowWith(int lhs) Reverse-raise to power: Raise another value of double type to this power with metatag processingbooleanraweq(double val) Equals: Perform direct equality comparison with a double value without metatag processing.booleanraweq(int val) Equals: Perform direct equality comparison with a int value without metatag processing.booleanEquals: Perform direct equality comparison with another value without metatag processing.voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) intPerform string comparison with another value known to be aLuaStringusing string comparison based on byte values.strvalue()sub(double rhs) Subtract: Perform numeric subtract operation with another value of double type with metatag processingsub(int rhs) Subtract: Perform numeric subtract operation with another value of int type with metatag processingSubtract: Perform numeric subtract operation with another value of unknown type, including metatag processing.subFrom(double lhs) Reverse-subtract: Perform numeric subtract operation from an int value with metatag processingsubFrom(int lhs) Reverse-subtract: Perform numeric subtract operation from a double value without metatag processingbytetobyte()Convert to byte if numeric, or 0 if not.chartochar()Convert to char if numeric, or 0 if not.doubletodouble()Convert to double if numeric, or 0 if not.floattofloat()Convert to float if numeric, or 0 if not.inttoint()Convert to int if numeric, or 0 if not.Convert to human readable String for any type.longtolong()Convert to long if numeric, or 0 if not.shorttoshort()Convert to short if numeric, or 0 if not.tostring()Conditionally convert to lua string without throwing errors.static LuaIntegervalueOf(int i) static LuaNumbervalueOf(long l) Return a LuaNumber that represents the value providedvoidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.luaj.LuaNumber
checknumber, checknumber, concat, concat, concatTo, concatTo, getmetatable, isnumber, optnumber, tonumber, type, typenameMethods inherited from class com.prineside.luaj.LuaValue
and, arg, arg1, argerror, assert_, buffer, cachedDouble, cachedInt, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, call, call, call, call, call, checkboolean, checkclosure, checkfunction, checkglobals, checknotnil, checktable, checkthread, checkuserdata, checkuserdata, comparemt, concatmt, concatTo, eqmtcall, error, get, get, get, inext, initupvalue1, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isnil, istable, isthread, isuserdata, isuserdata, isvalidkey, len, length, listOf, listOf, load, metatag, method, method, method, method, method, method, narg, neq, neq_b, 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, setmetatable, strcmp, strongvalue, subargs, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, toString, touserdata, touserdata, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOfMethods inherited from class com.prineside.luaj.Varargs
argcheck, 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, type
-
Field Details
-
v
public int vThe value being held by this instance.
-
-
Method Details
-
valueOf
-
valueOf
Return a LuaNumber that represents the value provided- Parameters:
l- long value to represent.- Returns:
- LuaNumber that is eithe LuaInteger or LuaDouble representing l
- See Also:
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
writein interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
readin interfacecom.esotericsoftware.kryo.KryoSerializable
-
isint
public boolean isint()Description copied from class:LuaValueCheck ifthisis anumberand is representable by java int without rounding or truncation -
isinttype
public boolean isinttype()Description copied from class:LuaValue -
islong
public boolean islong()Description copied from class:LuaValueCheck ifthisis anumberand is representable by java long without rounding or truncation -
tobyte
public byte tobyte()Description copied from class:LuaValueConvert to byte if numeric, or 0 if not. -
tochar
public char tochar()Description copied from class:LuaValueConvert to char if numeric, or 0 if not. -
todouble
public double todouble()Description copied from class:LuaValueConvert to double if numeric, or 0 if not. -
tofloat
public float tofloat()Description copied from class:LuaValueConvert to float if numeric, or 0 if not. -
toint
public int toint()Description copied from class:LuaValueConvert to int if numeric, or 0 if not. -
tolong
public long tolong()Description copied from class:LuaValueConvert to long if numeric, or 0 if not. -
toshort
public short toshort()Description copied from class:LuaValueConvert to short if numeric, or 0 if not. -
optdouble
public double optdouble(double defval) Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return as double -
optint
public int optint(int defval) Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return as int -
optinteger
Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return asLuaInteger- Overrides:
optintegerin classLuaValue- Parameters:
defval-LuaIntegerto return ifthisis nil or none- Returns:
thisconverted and wrapped inLuaIntegerif numeric,defvalif nil or none, throwsLuaErrorotherwise- See Also:
-
optlong
public long optlong(long defval) Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return as long -
tojstring
Description copied from class:LuaValueConvert to human readable String for any type. -
strvalue
Description copied from class:LuaValue -
optstring
Description copied from class:LuaValueCheck that optional argument is a string or number and return asLuaString -
tostring
Description copied from class:LuaValueConditionally convert to lua string without throwing errors.In lua all numbers are strings, so this function will return the
LuaValuethisif it is a string or number, andLuaValue.NILfor all other cases.This allows values to be tested for their "string-ness" without the penalty of throwing exceptions.
- Overrides:
tostringin classLuaValue- Returns:
thisif it is aLuaStringorLuaNumber, otherwiseLuaValue.NIL- See Also:
-
optjstring
Description copied from class:LuaValueCheck that optional argument is a string or number and return as Java String- Overrides:
optjstringin classLuaValue- Parameters:
defval-LuaStringto return ifthisis nil or none- Returns:
thisconverted to String if a string or number,defvalif nil or none, throwsLuaErrorif some other type- See Also:
-
checkinteger
Description copied from class:LuaValueCheck that the value is numeric, and convert and cast value to int, or throwLuaErrorif not numericValues that are
LuaNumberwill be cast to int and may lose precision. Values that areLuaStringthat can be converted to a number will be converted, then cast to int, so may also lose precision.- Overrides:
checkintegerin classLuaValue- Returns:
- value cast to a int and wrapped in
LuaIntegerif numeric - See Also:
-
isstring
public boolean isstring()Description copied from class:LuaValueCheck ifthisis astring -
hashCode
public int hashCode() -
hashCode
public static int hashCode(int x) -
neg
Description copied from class:LuaValueUnary minus: return negative value(-this)as defined by lua unary minus operator- Overrides:
negin classLuaValue- Returns:
- boolean inverse as
LuaBooleanif boolean or nil, numeric inverse asLuaNumberif numeric, or metatag processing result ifLuaValue.UNMmetatag is defined
-
equals
-
eq
Description copied from class:LuaValueEquals: Perform equality comparison with another value including metatag processing usingLuaValue.EQ.- Overrides:
eqin classLuaValue- Parameters:
val- The value to compare with.- Returns:
LuaValue.TRUEif values are comparable and(this == rhs),LuaValue.FALSEif comparable but not equal,LuaValueif metatag processing occurs.- See Also:
-
eq_b
Description copied from class:LuaValueEquals: Perform equality comparison with another value including metatag processing usingLuaValue.EQ, and return java boolean -
raweq
Description copied from class:LuaValueEquals: Perform direct equality comparison with another value without metatag processing. -
raweq
public boolean raweq(double val) Description copied from class:LuaValueEquals: Perform direct equality comparison with a double value without metatag processing. -
raweq
public boolean raweq(int val) Description copied from class:LuaValueEquals: Perform direct equality comparison with a int value without metatag processing. -
add
Description copied from class:LuaValue -
add
Description copied from class:LuaValueAdd: Perform numeric add operation with another value of double type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
add
Description copied from class:LuaValueAdd: Perform numeric add operation with another value of int type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
sub
Description copied from class:LuaValue -
sub
Description copied from class:LuaValueSubtract: Perform numeric subtract operation with another value of double type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
sub
Description copied from class:LuaValueSubtract: Perform numeric subtract operation with another value of int type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
subFrom
Description copied from class:LuaValueReverse-subtract: Perform numeric subtract operation from an int value with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
subFrom
Description copied from class:LuaValueReverse-subtract: Perform numeric subtract operation from a double value without metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a numberFor metatag processing
LuaValue.sub(LuaValue)must be used -
mul
Description copied from class:LuaValue -
mul
Description copied from class:LuaValueMultiply: Perform numeric multiply operation with another value of double type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
mul
Description copied from class:LuaValueMultiply: Perform numeric multiply operation with another value of int type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
pow
Description copied from class:LuaValue -
pow
Description copied from class:LuaValueRaise to power: Raise this value to a power of double type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
pow
Description copied from class:LuaValueRaise to power: Raise this value to a power of int type with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
powWith
Description copied from class:LuaValueReverse-raise to power: Raise another value of double type to this power with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
powWith
Description copied from class:LuaValueReverse-raise to power: Raise another value of double type to this power with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
div
Description copied from class:LuaValue -
div
Description copied from class:LuaValueDivide: Perform numeric divide operation by another value of double type without metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a numberFor metatag processing
LuaValue.div(LuaValue)must be used -
div
Description copied from class:LuaValueDivide: Perform numeric divide operation by another value of int type without metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a numberFor metatag processing
LuaValue.div(LuaValue)must be used -
divInto
Description copied from class:LuaValueReverse-divide: Perform numeric divide operation into another value with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
mod
Description copied from class:LuaValue -
mod
Description copied from class:LuaValueModulo: Perform numeric modulo operation with another value of double type without metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a numberFor metatag processing
LuaValue.mod(LuaValue)must be used -
mod
Description copied from class:LuaValueModulo: Perform numeric modulo operation with another value of int type without metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a numberFor metatag processing
LuaValue.mod(LuaValue)must be used -
modFrom
Description copied from class:LuaValueReverse-modulo: Perform numeric modulo operation from another value with metatag processingthismust derive fromLuaNumberor derive fromLuaStringand be convertible to a number -
lt
Description copied from class:LuaValueLess than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber.- Overrides:
ltin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this < rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
lt
Description copied from class:LuaValueLess than: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
ltin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this < rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
lt
Description copied from class:LuaValueLess than: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
ltin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this < rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
lt_b
Description copied from class:LuaValueLess than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber. -
lt_b
public boolean lt_b(int rhs) Description copied from class:LuaValueLess than: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.To be comparable, this must derive from
LuaNumber. -
lt_b
public boolean lt_b(double rhs) Description copied from class:LuaValueLess than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber. -
lteq
Description copied from class:LuaValueLess than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber.- Overrides:
lteqin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this <= rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
lteq
Description copied from class:LuaValueLess than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
lteqin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this <= rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
lteq
Description copied from class:LuaValueLess than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
lteqin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this <= rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
lteq_b
Description copied from class:LuaValueLess than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber. -
lteq_b
public boolean lteq_b(int rhs) Description copied from class:LuaValueLess than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.To be comparable, this must derive from
LuaNumber. -
lteq_b
public boolean lteq_b(double rhs) Description copied from class:LuaValueLess than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returning java boolean.To be comparable, this must derive from
LuaNumber. -
gt
Description copied from class:LuaValueGreater than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber.- Overrides:
gtin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this > rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
gt
Description copied from class:LuaValueGreater than: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
gtin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this > rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
gt
Description copied from class:LuaValueGreater than: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
gtin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this > rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
gt_b
Description copied from class:LuaValueGreater than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber. -
gt_b
public boolean gt_b(int rhs) Description copied from class:LuaValueGreater than: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.To be comparable, this must derive from
LuaNumber. -
gt_b
public boolean gt_b(double rhs) Description copied from class:LuaValueGreater than: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber. -
gteq
Description copied from class:LuaValueGreater than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returningLuaValue.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber.- Overrides:
gteqin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this >= rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
gteq
Description copied from class:LuaValueGreater than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
gteqin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this >= rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
gteq
Description copied from class:LuaValueGreater than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue.To be comparable, this must derive from
LuaNumber.- Overrides:
gteqin classLuaValue- Parameters:
rhs- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUEif(this >= rhs),LuaValue.FALSEif not, orLuaValueif metatag processing occurs- See Also:
-
gteq_b
Description copied from class:LuaValueGreater than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.To be comparable, both operands must derive from
LuaStringor both must derive fromLuaNumber. -
gteq_b
public boolean gteq_b(int rhs) Description copied from class:LuaValueGreater than or equals: Perform numeric comparison with another value of int type, including metatag processing, and returning java boolean.To be comparable, this must derive from
LuaNumber. -
gteq_b
public boolean gteq_b(double rhs) Description copied from class:LuaValueGreater than or equals: Perform numeric comparison with another value of double type, including metatag processing, and returning java boolean.To be comparable, this must derive from
LuaNumber. -
strcmp
Description copied from class:LuaValue -
checkint
public int checkint()Description copied from class:LuaValueCheck that the value is numeric, and convert and cast value to int, or throwLuaErrorif not numericValues that are
LuaNumberwill be cast to int and may lose precision. Values that areLuaStringthat can be converted to a number will be converted, then cast to int, so may also lose precision. -
checklong
public long checklong()Description copied from class:LuaValueCheck that the value is numeric, and convert and cast value to long, or throwLuaErrorif not numericValues that are
LuaNumberwill be cast to long and may lose precision. Values that areLuaStringthat can be converted to a number will be converted, then cast to long, so may also lose precision. -
checkdouble
public double checkdouble()Description copied from class:LuaValueCheck that the value is numeric and return the value as a double, or throwLuaErrorif not numericValues that are
LuaNumberand values that areLuaStringthat can be converted to a number will be converted to double.- Overrides:
checkdoublein classLuaValue- Returns:
- value cast to a double if numeric
- See Also:
-
checkjstring
Description copied from class:LuaValueConvert this value to a Java String.The 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.
- Overrides:
checkjstringin classLuaValue- Returns:
- String representation of the value
- See Also:
-
checkstring
Description copied from class:LuaValueCheck that this is a lua string, or throwLuaErrorif it is not.In lua all numbers are strings, so this will succeed for anything that derives from
LuaStringorLuaNumber. Numbers will be converted toLuaString.- Overrides:
checkstringin classLuaValue- Returns:
LuaStringrepresentation of the value if it is aLuaStringorLuaNumber- See Also:
-