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_metatable
Fields 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.double
Check that the value is numeric and return the value as a double, or throwLuaError
if not numericint
checkint()
Check that the value is numeric, and convert and cast value to int, or throwLuaError
if not numericCheck that the value is numeric, and convert and cast value to int, or throwLuaError
if not numericConvert this value to a Java String.long
Check that the value is numeric, and convert and cast value to long, or throwLuaError
if not numericCheck that this is a lua string, or throwLuaError
if 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
.boolean
Equals: Perform equality comparison with another value including metatag processing usingLuaValue.EQ
, and return java booleanboolean
gt
(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
.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
Greater 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
.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
Greater than or equals: Perform numeric or string comparison with another value of unknown type, including metatag processing, and returning java boolean.int
hashCode()
static int
hashCode
(int x) boolean
isint()
Check ifthis
is anumber
and is representable by java int without rounding or truncationboolean
Check ifthis
is aLuaInteger
boolean
islong()
Check ifthis
is anumber
and is representable by java long without rounding or truncationboolean
isstring()
Check ifthis
is astring
lt
(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
.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
Less 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
.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
Less 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 operatordouble
optdouble
(double defval) Check that optional argument is a number or string convertible to number and return as doubleint
optint
(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 asLuaInteger
optjstring
(String defval) Check that optional argument is a string or number and return as Java Stringlong
optlong
(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 asLuaString
pow
(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 processingboolean
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
Equals: Perform direct equality comparison with another value without metatag processing.void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) int
Perform string comparison with another value known to be aLuaString
using 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 processingbyte
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.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.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 providedvoid
write
(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, typename
Methods 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, varargsOf
Methods 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:
write
in interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
read
in interfacecom.esotericsoftware.kryo.KryoSerializable
-
isint
public boolean isint()Description copied from class:LuaValue
Check ifthis
is anumber
and 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:LuaValue
Check ifthis
is anumber
and is representable by java long without rounding or truncation -
tobyte
public byte tobyte()Description copied from class:LuaValue
Convert to byte if numeric, or 0 if not. -
tochar
public char tochar()Description copied from class:LuaValue
Convert to char if numeric, or 0 if not. -
todouble
public double todouble()Description copied from class:LuaValue
Convert to double if numeric, or 0 if not. -
tofloat
public float tofloat()Description copied from class:LuaValue
Convert to float if numeric, or 0 if not. -
toint
public int toint()Description copied from class:LuaValue
Convert to int if numeric, or 0 if not. -
tolong
public long tolong()Description copied from class:LuaValue
Convert to long if numeric, or 0 if not. -
toshort
public short toshort()Description copied from class:LuaValue
Convert to short if numeric, or 0 if not. -
optdouble
public double optdouble(double defval) Description copied from class:LuaValue
Check 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:LuaValue
Check that optional argument is a number or string convertible to number and return as int -
optinteger
Description copied from class:LuaValue
Check that optional argument is a number or string convertible to number and return asLuaInteger
- Overrides:
optinteger
in classLuaValue
- Parameters:
defval
-LuaInteger
to return ifthis
is nil or none- Returns:
this
converted and wrapped inLuaInteger
if numeric,defval
if nil or none, throwsLuaError
otherwise- See Also:
-
optlong
public long optlong(long defval) Description copied from class:LuaValue
Check that optional argument is a number or string convertible to number and return as long -
tojstring
Description copied from class:LuaValue
Convert to human readable String for any type. -
strvalue
Description copied from class:LuaValue
-
optstring
Description copied from class:LuaValue
Check that optional argument is a string or number and return asLuaString
-
tostring
Description copied from class:LuaValue
Conditionally convert to lua string without throwing errors.In lua all numbers are strings, so this function will return the
LuaValue
this
if it is a string or number, andLuaValue.NIL
for all other cases.This allows values to be tested for their "string-ness" without the penalty of throwing exceptions.
- Overrides:
tostring
in classLuaValue
- Returns:
this
if it is aLuaString
orLuaNumber
, otherwiseLuaValue.NIL
- See Also:
-
optjstring
Description copied from class:LuaValue
Check that optional argument is a string or number and return as Java String- Overrides:
optjstring
in classLuaValue
- Parameters:
defval
-LuaString
to return ifthis
is nil or none- Returns:
this
converted to String if a string or number,defval
if nil or none, throwsLuaError
if some other type- See Also:
-
checkinteger
Description copied from class:LuaValue
Check that the value is numeric, and convert and cast value to int, or throwLuaError
if not numericValues that are
LuaNumber
will be cast to int and may lose precision. Values that areLuaString
that can be converted to a number will be converted, then cast to int, so may also lose precision.- Overrides:
checkinteger
in classLuaValue
- Returns:
- value cast to a int and wrapped in
LuaInteger
if numeric - See Also:
-
isstring
public boolean isstring()Description copied from class:LuaValue
Check ifthis
is astring
-
hashCode
public int hashCode() -
hashCode
public static int hashCode(int x) -
neg
Description copied from class:LuaValue
Unary minus: return negative value(-this)
as defined by lua unary minus operator- Overrides:
neg
in classLuaValue
- Returns:
- boolean inverse as
LuaBoolean
if boolean or nil, numeric inverse asLuaNumber
if numeric, or metatag processing result ifLuaValue.UNM
metatag is defined
-
equals
-
eq
Description copied from class:LuaValue
Equals: Perform equality comparison with another value including metatag processing usingLuaValue.EQ
.- Overrides:
eq
in classLuaValue
- Parameters:
val
- The value to compare with.- Returns:
LuaValue.TRUE
if values are comparable and(this == rhs)
,LuaValue.FALSE
if comparable but not equal,LuaValue
if metatag processing occurs.- See Also:
-
eq_b
Description copied from class:LuaValue
Equals: Perform equality comparison with another value including metatag processing usingLuaValue.EQ
, and return java boolean -
raweq
Description copied from class:LuaValue
Equals: Perform direct equality comparison with another value without metatag processing. -
raweq
public boolean raweq(double val) Description copied from class:LuaValue
Equals: Perform direct equality comparison with a double value without metatag processing. -
raweq
public boolean raweq(int val) Description copied from class:LuaValue
Equals: Perform direct equality comparison with a int value without metatag processing. -
add
Description copied from class:LuaValue
-
add
Description copied from class:LuaValue
Add: Perform numeric add operation with another value of double type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
add
Description copied from class:LuaValue
Add: Perform numeric add operation with another value of int type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
sub
Description copied from class:LuaValue
-
sub
Description copied from class:LuaValue
Subtract: Perform numeric subtract operation with another value of double type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
sub
Description copied from class:LuaValue
Subtract: Perform numeric subtract operation with another value of int type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
subFrom
Description copied from class:LuaValue
Reverse-subtract: Perform numeric subtract operation from an int value with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
subFrom
Description copied from class:LuaValue
Reverse-subtract: Perform numeric subtract operation from a double value without metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a numberFor metatag processing
LuaValue.sub(LuaValue)
must be used -
mul
Description copied from class:LuaValue
-
mul
Description copied from class:LuaValue
Multiply: Perform numeric multiply operation with another value of double type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
mul
Description copied from class:LuaValue
Multiply: Perform numeric multiply operation with another value of int type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
pow
Description copied from class:LuaValue
-
pow
Description copied from class:LuaValue
Raise to power: Raise this value to a power of double type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
pow
Description copied from class:LuaValue
Raise to power: Raise this value to a power of int type with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
powWith
Description copied from class:LuaValue
Reverse-raise to power: Raise another value of double type to this power with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
powWith
Description copied from class:LuaValue
Reverse-raise to power: Raise another value of double type to this power with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
div
Description copied from class:LuaValue
-
div
Description copied from class:LuaValue
Divide: Perform numeric divide operation by another value of double type without metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a numberFor metatag processing
LuaValue.div(LuaValue)
must be used -
div
Description copied from class:LuaValue
Divide: Perform numeric divide operation by another value of int type without metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a numberFor metatag processing
LuaValue.div(LuaValue)
must be used -
divInto
Description copied from class:LuaValue
Reverse-divide: Perform numeric divide operation into another value with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
mod
Description copied from class:LuaValue
-
mod
Description copied from class:LuaValue
Modulo: Perform numeric modulo operation with another value of double type without metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a numberFor metatag processing
LuaValue.mod(LuaValue)
must be used -
mod
Description copied from class:LuaValue
Modulo: Perform numeric modulo operation with another value of int type without metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a numberFor metatag processing
LuaValue.mod(LuaValue)
must be used -
modFrom
Description copied from class:LuaValue
Reverse-modulo: Perform numeric modulo operation from another value with metatag processingthis
must derive fromLuaNumber
or derive fromLuaString
and be convertible to a number -
lt
Description copied from class:LuaValue
Less 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
LuaString
or both must derive fromLuaNumber
.- Overrides:
lt
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this < rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
lt
Description copied from class:LuaValue
Less than: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue
.To be comparable, this must derive from
LuaNumber
.- Overrides:
lt
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this < rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
lt
Description copied from class:LuaValue
Less than: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue
.To be comparable, this must derive from
LuaNumber
.- Overrides:
lt
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this < rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
lt_b
Description copied from class:LuaValue
Less 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
LuaString
or both must derive fromLuaNumber
. -
lt_b
public boolean lt_b(int rhs) Description copied from class:LuaValue
Less 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:LuaValue
Less 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
LuaString
or both must derive fromLuaNumber
. -
lteq
Description copied from class:LuaValue
Less 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
LuaString
or both must derive fromLuaNumber
.- Overrides:
lteq
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this <= rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
lteq
Description copied from class:LuaValue
Less 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:
lteq
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this <= rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
lteq
Description copied from class:LuaValue
Less 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:
lteq
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this <= rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
lteq_b
Description copied from class:LuaValue
Less 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
LuaString
or both must derive fromLuaNumber
. -
lteq_b
public boolean lteq_b(int rhs) Description copied from class:LuaValue
Less 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:LuaValue
Less 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:LuaValue
Greater 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
LuaString
or both must derive fromLuaNumber
.- Overrides:
gt
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this > rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
gt
Description copied from class:LuaValue
Greater than: Perform numeric comparison with another value of double type, including metatag processing, and returningLuaValue
.To be comparable, this must derive from
LuaNumber
.- Overrides:
gt
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this > rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
gt
Description copied from class:LuaValue
Greater than: Perform numeric comparison with another value of int type, including metatag processing, and returningLuaValue
.To be comparable, this must derive from
LuaNumber
.- Overrides:
gt
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this > rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
gt_b
Description copied from class:LuaValue
Greater 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
LuaString
or both must derive fromLuaNumber
. -
gt_b
public boolean gt_b(int rhs) Description copied from class:LuaValue
Greater 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:LuaValue
Greater 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
LuaString
or both must derive fromLuaNumber
. -
gteq
Description copied from class:LuaValue
Greater 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
LuaString
or both must derive fromLuaNumber
.- Overrides:
gteq
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this >= rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
gteq
Description copied from class:LuaValue
Greater 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:
gteq
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this >= rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
gteq
Description copied from class:LuaValue
Greater 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:
gteq
in classLuaValue
- Parameters:
rhs
- The right-hand-side value to perform the comparison with- Returns:
LuaValue.TRUE
if(this >= rhs)
,LuaValue.FALSE
if not, orLuaValue
if metatag processing occurs- See Also:
-
gteq_b
Description copied from class:LuaValue
Greater 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
LuaString
or both must derive fromLuaNumber
. -
gteq_b
public boolean gteq_b(int rhs) Description copied from class:LuaValue
Greater 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:LuaValue
Greater 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:LuaValue
Check that the value is numeric, and convert and cast value to int, or throwLuaError
if not numericValues that are
LuaNumber
will be cast to int and may lose precision. Values that areLuaString
that 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:LuaValue
Check that the value is numeric, and convert and cast value to long, or throwLuaError
if not numericValues that are
LuaNumber
will be cast to long and may lose precision. Values that areLuaString
that 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:LuaValue
Check that the value is numeric and return the value as a double, or throwLuaError
if not numericValues that are
LuaNumber
and values that areLuaString
that can be converted to a number will be converted to double.- Overrides:
checkdouble
in classLuaValue
- Returns:
- value cast to a double if numeric
- See Also:
-
checkjstring
Description copied from class:LuaValue
Convert 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:
checkjstring
in classLuaValue
- Returns:
- String representation of the value
- See Also:
-
checkstring
Description copied from class:LuaValue
Check that this is a lua string, or throwLuaError
if it is not.In lua all numbers are strings, so this will succeed for anything that derives from
LuaString
orLuaNumber
. Numbers will be converted toLuaString
.- Overrides:
checkstring
in classLuaValue
- Returns:
LuaString
representation of the value if it is aLuaString
orLuaNumber
- See Also:
-