org.luaj.vm
Class LNumber

java.lang.Object
  extended by org.luaj.vm.LValue
      extended by org.luaj.vm.LNumber
Direct Known Subclasses:
LDouble, LInteger

public abstract class LNumber
extends LValue


Field Summary
 
Fields inherited from class org.luaj.vm.LValue
TM_INDEX, TM_METATABLE, TM_MODE, TM_NEWINDEX
 
Constructor Summary
LNumber()
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Compare for equivalence by using lua op comparator
abstract  boolean isInteger()
          Returns false by default for non-LNumbers, but subclasses of LNumber must override.
 boolean isNumber()
          Returns true if this is or can be made into a number
 boolean isString()
          In lua all numbers are strings !
 void luaConcatTo(java.io.ByteArrayOutputStream baos)
          Write as a string
 int luaGetType()
          Valid for all types: return the int value identifying the type of this value
 LValue luaToNumber()
          Convert to a number if possible, or nil otherwise
 java.lang.Byte toJavaBoxedByte()
          Convert to a Byte value
 java.lang.Character toJavaBoxedCharacter()
          Convert to a boxed Character value
 java.lang.Double toJavaBoxedDouble()
          Convert to a boxed Double value
 java.lang.Float toJavaBoxedFloat()
          Convert to a boxed Float value
 java.lang.Integer toJavaBoxedInteger()
          Convert to a boxed Integer value
 java.lang.Long toJavaBoxedLong()
          Convert to a boxed Long value
 java.lang.Short toJavaBoxedShort()
          Convert to a boxed Short value
 
Methods inherited from class org.luaj.vm.LValue
compareError, conversionError, id, isClosure, isFunction, isNil, isTable, isUserData, luaAsString, luaBinCmpDouble, luaBinCmpInteger, luaBinCmpString, luaBinCmpUnknown, luaBinOpDouble, luaBinOpInteger, luaBinOpUnknown, luaGetEnv, luaGetMetatable, luaGetTable, luaGetTypeName, luaLength, luaSetEnv, luaSetMetatable, luaSetTable, luaStackCall, luaUnaryMinus, toJavaBoolean, toJavaBoxedBoolean, toJavaByte, toJavaChar, toJavaDouble, toJavaFloat, toJavaInstance, toJavaInt, toJavaLong, toJavaShort, toJavaString, toString, toStrongReference
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LNumber

public LNumber()
Method Detail

equals

public boolean equals(java.lang.Object o)
Compare for equivalence by using lua op comparator

Overrides:
equals in class java.lang.Object

luaGetType

public int luaGetType()
Description copied from class: LValue
Valid for all types: return the int value identifying the type of this value

Specified by:
luaGetType in class LValue

isInteger

public abstract boolean isInteger()
Returns false by default for non-LNumbers, but subclasses of LNumber must override.

Overrides:
isInteger in class LValue

isString

public boolean isString()
In lua all numbers are strings !

Overrides:
isString in class LValue

toJavaBoxedByte

public java.lang.Byte toJavaBoxedByte()
Convert to a Byte value

Overrides:
toJavaBoxedByte in class LValue

toJavaBoxedCharacter

public java.lang.Character toJavaBoxedCharacter()
Convert to a boxed Character value

Overrides:
toJavaBoxedCharacter in class LValue

toJavaBoxedDouble

public java.lang.Double toJavaBoxedDouble()
Convert to a boxed Double value

Overrides:
toJavaBoxedDouble in class LValue

toJavaBoxedFloat

public java.lang.Float toJavaBoxedFloat()
Convert to a boxed Float value

Overrides:
toJavaBoxedFloat in class LValue

toJavaBoxedInteger

public java.lang.Integer toJavaBoxedInteger()
Convert to a boxed Integer value

Overrides:
toJavaBoxedInteger in class LValue

toJavaBoxedLong

public java.lang.Long toJavaBoxedLong()
Convert to a boxed Long value

Overrides:
toJavaBoxedLong in class LValue

toJavaBoxedShort

public java.lang.Short toJavaBoxedShort()
Convert to a boxed Short value

Overrides:
toJavaBoxedShort in class LValue

luaToNumber

public LValue luaToNumber()
Convert to a number if possible, or nil otherwise

Overrides:
luaToNumber in class LValue

luaConcatTo

public void luaConcatTo(java.io.ByteArrayOutputStream baos)
Write as a string

Overrides:
luaConcatTo in class LValue

isNumber

public boolean isNumber()
Returns true if this is or can be made into a number

Overrides:
isNumber in class LValue


Copyright © 2007-2013 Luaj.org. All Rights Reserved.