Class LuaNumber
- All Implemented Interfaces:
 KryoSerializable
- 
Nested Class Summary
Nested classes/interfaces inherited from class com.prineside.luaj.LuaValue
LuaValue.NillableSerializer, LuaValue.NoneNested classes/interfaces inherited from class com.prineside.luaj.Varargs
Varargs.ArrayVarargs - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final LuaNumberstatic final LuaNumberstatic final LuaNumberstatic LuaValueShared static metatable for all number values represented in lua.Fields inherited from class com.prineside.luaj.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, ENV, EQ, FALSE, INDEX, IPAIRS, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILLABLE_SERIALIZER, NILS, NONE, NOVALS, ONE, PAIRS, 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: 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 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 the value is numeric, and return as a LuaNumber if so, or throwLuaErrorchecknumber(String errmsg) Check that the value is numeric, and return as a LuaNumber if so, or throwLuaErrorCheck that this is a lua string, or throwLuaErrorif it is not.Concatenate aBufferonto this value and return the result using rules of lua string concatenation including metatag processing.Concatenate another value onto this value and return the result using rules of lua string concatenation including metatag processing.Reverse-concatenation: concatenate this value onto another value known to be aLuaNumberand return the result using rules of lua string concatenation including metatag processing.Reverse-concatenation: concatenate this value onto another value known to be aLuaStringand return the result using rules of lua string concatenation including metatag processing.static LuaValueddiv(double lhs, double rhs) Divide two double numbers according to lua math, and return aLuaValueresult.static doubleddiv_d(double lhs, double rhs) Divide two double numbers according to lua math, and return a double result.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 processingstatic LuaValuedmod(double lhs, double rhs) Take modulo double numbers according to lua math, and return aLuaValueresult.static doubledmod_d(double lhs, double rhs) Take modulo for double numbers according to lua math, and return a double result.Equals: 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 booleanbooleanGet the metatable for thisLuaValuegt(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 an intbooleanislong()Check ifthisis anumberand is representable by java long without rounding or truncationbooleanisnumber()Check ifthisis anumberbooleanisstring()Check ifthisis astringbooleanReturn true if this is a valid key in a table index operation.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.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 intoptjstring(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 number or string convertible to number and return asLuaNumberCheck that optional argument is a string or number and return asLuaStringintpow(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.voidvoidsetDirectly(double v) 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 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.tonumber()Conditionally convert to lua number without throwing errors.shorttoshort()Convert to short if numeric, or 0 if not.tostring()Conditionally convert to lua string without throwing errors.inttype()Get the enumeration value for the type of this value.typename()Get the String name of the type of this value.static LuaNumbervalueOf(double d) static LuaNumbervalueOf(int d) voidMethods inherited from class com.prineside.luaj.LuaValue
add, and, arg, arg1, argerror, assert_, buffer, call, call, call, call, call, cBool, cDouble, cFloat, checkboolean, checkclosure, checkfunction, checkglobals, checknotnil, checktable, checkuserdata, checkuserdata, cInt, cNcDouble, cNcFloat, cNcInt, cObject, comparemt, concatmt, concatTo, cRegObject, eqmtcall, error, get, get, get, inext, initupvalue1, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isnil, isRegObject, istable, isuserdata, isuserdata, len, length, listOf, listOf, load, metatag, method, method, method, method, method, method, narg, neq, neq_b, next, not, onInvoke, optboolean, optclosure, optfunction, opttable, 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, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, toString, touserdata, touserdata, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOfMethods inherited from class com.prineside.luaj.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkuserdata, checkuserdata, checkvalue, dealias, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optjstring, optlong, optnumber, optstring, opttable, optuserdata, optuserdata, optvalue, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type 
- 
Field Details
- 
NAN
 - 
POSINF
 - 
NEGINF
 - 
JSTR_NAN
- See Also:
 
 - 
JSTR_POSINF
- See Also:
 
 - 
JSTR_NEGINF
- See Also:
 
 - 
s_metatable
Shared static metatable for all number values represented in lua. 
 - 
 - 
Method Details
- 
write
- Specified by:
 writein interfaceKryoSerializable
 - 
read
- Specified by:
 readin interfaceKryoSerializable
 - 
hashCode
public static int hashCode(int x)  - 
valueOf
 - 
valueOf
 - 
setDirectly
public void setDirectly(double v)  - 
hashCode
public int hashCode() - 
originalHashCode
public int originalHashCode() - 
islong
public boolean islong()Description copied from class:LuaValueCheck ifthisis anumberand is representable by java long without rounding or truncation - 
isinttype
public boolean isinttype()Description copied from class:LuaValueCheck ifthisis an intNo attempt to convert from string will be made by this call.
 - 
isint
public boolean isint()Description copied from class:LuaValueCheck ifthisis anumberand is representable by java int 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 - 
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 - 
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 - 
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 - 
mul
Description copied from class:LuaValue - 
mul
Description copied from class:LuaValue - 
mul
Description copied from class:LuaValue - 
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 - 
ddiv
Divide two double numbers according to lua math, and return aLuaValueresult.- Parameters:
 lhs- Left-hand-side of the division.rhs- Right-hand-side of the division.- Returns:
 LuaValuefor the result of the division, taking into account positive and negiative infinity, and Nan- See Also:
 
 - 
ddiv_d
public static double ddiv_d(double lhs, double rhs) Divide two double numbers according to lua math, and return a double result.- Parameters:
 lhs- Left-hand-side of the division.rhs- Right-hand-side of the division.- Returns:
 - Value of the division, taking into account positive and negative infinity, and Nan
 - See Also:
 
 - 
dmod
Take modulo double numbers according to lua math, and return aLuaValueresult.- Parameters:
 lhs- Left-hand-side of the modulo.rhs- Right-hand-side of the modulo.- Returns:
 LuaValuefor the result of the modulo, using lua's rules for modulo- See Also:
 
 - 
dmod_d
public static double dmod_d(double lhs, double rhs) Take modulo for double numbers according to lua math, and return a double result.- Parameters:
 lhs- Left-hand-side of the modulo.rhs- Right-hand-side of the modulo.- Returns:
 - double value for the result of the modulo, using lua's rules for modulo
 - See Also:
 
 - 
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 - 
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:
 
 - 
optnumber
Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return asLuaNumber - 
isnumber
public boolean isnumber()Description copied from class:LuaValueCheck ifthisis anumber - 
isstring
public boolean isstring()Description copied from class:LuaValueCheck ifthisis astring - 
tonumber
Description copied from class:LuaValueConditionally convert to lua number without throwing errors.In lua all numbers are strings, but not all strings are numbers. This function will return the
LuaValuethisif it is a number or a string convertible to a number, andLuaValue.NILfor all other cases.This allows values to be tested for their "numeric-ness" without the penalty of throwing exceptions, nor the cost of converting the type and creating storage for it.
- Overrides:
 tonumberin classLuaValue- Returns:
 thisif it is aLuaNumberorLuaStringthat can be converted to a number, otherwiseLuaValue.NIL- See Also:
 
 - 
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. - 
checknumber
Description copied from class:LuaValueCheck that the value is numeric, and return as a LuaNumber if so, or throwLuaErrorValues that are
LuaStringthat can be converted to a number will be converted and returned.- Overrides:
 checknumberin classLuaValue- Returns:
 - value as a 
LuaNumberif numeric - See Also:
 
 - 
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:
 
 - 
isvalidkey
public boolean isvalidkey()Description copied from class:LuaValueReturn true if this is a valid key in a table index operation.- Overrides:
 isvalidkeyin classLuaValue- Returns:
 - true if valid as a table key, otherwise false
 - See Also:
 
 - 
type
public int type()Description copied from class:LuaValueGet the enumeration value for the type of this value.- Specified by:
 typein classLuaValue- Returns:
 - value for this type, one of
 
LuaValue.TNIL,LuaValue.TBOOLEAN,LuaValue.TNUMBER,LuaValue.TSTRING,LuaValue.TTABLE,LuaValue.TFUNCTION,LuaValue.TUSERDATA,LuaValue.TTHREAD - See Also:
 
 - 
typename
Description copied from class:LuaValueGet the String name of the type of this value.- Specified by:
 typenamein classLuaValue- Returns:
 - name from type name list 
LuaValue.TYPE_NAMEScorresponding to the type of this value: "nil", "boolean", "number", "string", "table", "function", "userdata", "thread" - See Also:
 
 - 
checknumber
Description copied from class:LuaValueCheck that the value is numeric, and return as a LuaNumber if so, or throwLuaErrorValues that are
LuaStringthat can be converted to a number will be converted and returned.- Overrides:
 checknumberin classLuaValue- Parameters:
 errmsg- String message to supply if conversion fails- Returns:
 - value as a 
LuaNumberif numeric - See Also:
 
 - 
getmetatable
Description copied from class:LuaValueGet the metatable for thisLuaValueFor
LuaTableandLuaUserdatainstances, the metatable returned is this instance metatable. For all other types, the class metatable value will be returned.- Overrides:
 getmetatablein classLuaValue- Returns:
 - metatable, or null if it there is none
 
 - 
concat
Description copied from class:LuaValue - 
concat
Description copied from class:LuaValue - 
concatTo
Description copied from class:LuaValueReverse-concatenation: concatenate this value onto another value known to be aLuaNumberand return the result using rules of lua string concatenation including metatag processing.Only strings and numbers as represented can be concatenated, meaning each operand must derive from
LuaStringorLuaNumber. - 
concatTo
Description copied from class:LuaValueReverse-concatenation: concatenate this value onto another value known to be aLuaStringand return the result using rules of lua string concatenation including metatag processing.Only strings and numbers as represented can be concatenated, meaning each operand must derive from
LuaStringorLuaNumber. 
 -