Add LValue.toJavaX and VM.pushboxedx() functions for all java basic type conversions
This commit is contained in:
@@ -22,4 +22,40 @@ public class LNumber extends LValue {
|
||||
* override.
|
||||
*/
|
||||
public abstract boolean isInteger();
|
||||
|
||||
/** Convert to a Byte value */
|
||||
public Byte toJavaBoxedByte() {
|
||||
return new Byte(toJavaByte());
|
||||
}
|
||||
|
||||
/** Convert to a boxed Character value */
|
||||
public Character toJavaBoxedCharacter() {
|
||||
return new Character(toJavaChar());
|
||||
}
|
||||
|
||||
/** Convert to a boxed Double value */
|
||||
public Double toJavaBoxedDouble() {
|
||||
return new Double(toJavaDouble());
|
||||
}
|
||||
|
||||
/** Convert to a boxed Float value */
|
||||
public Float toJavaBoxedFloat() {
|
||||
return new Float(toJavaFloat());
|
||||
}
|
||||
|
||||
/** Convert to a boxed Integer value */
|
||||
public Integer toJavaBoxedInteger() {
|
||||
return new Integer(toJavaInt());
|
||||
}
|
||||
|
||||
/** Convert to a boxed Long value */
|
||||
public Long toJavaBoxedLong() {
|
||||
return new Long(toJavaLong());
|
||||
}
|
||||
|
||||
/** Convert to a boxed Short value */
|
||||
public Short toJavaBoxedShort() {
|
||||
return new Short(toJavaShort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user