|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bsh.Primitive
Wrapper for primitive types in Bsh. This is package public because it is used in the implementation of some bsh commands. See the note in LHS.java about wrapping objects.
Nested Class Summary | |
private static class |
Primitive.Special
|
Field Summary | |
static Primitive |
NULL
|
private java.lang.Object |
value
|
static Primitive |
VOID
VOID means "no type". |
Constructor Summary | |
|
Primitive(boolean value)
|
|
Primitive(java.lang.Boolean value)
|
|
Primitive(byte value)
|
|
Primitive(java.lang.Byte value)
|
|
Primitive(char value)
|
|
Primitive(java.lang.Character value)
|
|
Primitive(double value)
|
|
Primitive(java.lang.Double value)
|
|
Primitive(float value)
|
|
Primitive(java.lang.Float value)
|
|
Primitive(int value)
|
|
Primitive(java.lang.Integer value)
|
|
Primitive(long value)
|
|
Primitive(java.lang.Long value)
|
|
Primitive(java.lang.Number number)
|
private |
Primitive(java.lang.Object value)
|
|
Primitive(short value)
|
|
Primitive(java.lang.Short value)
|
Method Summary | |
static java.lang.Object |
binaryOperation(java.lang.Object obj1,
java.lang.Object obj2,
int kind)
Allow primitive operations on wrapper types such as Integer and Boolean. |
(package private) static java.lang.Object |
binaryOperationImpl(java.lang.Object lhs,
java.lang.Object rhs,
int kind)
|
(package private) static java.lang.Boolean |
booleanBinaryOperation(java.lang.Boolean B1,
java.lang.Boolean B2,
int kind)
|
(package private) static boolean |
booleanUnaryOperation(java.lang.Boolean B,
int kind)
|
boolean |
booleanValue()
|
(package private) static java.lang.Object |
doubleBinaryOperation(java.lang.Double D1,
java.lang.Double D2,
int kind)
|
(package private) static double |
doubleUnaryOperation(java.lang.Double D,
int kind)
|
boolean |
equals(java.lang.Object obj)
|
(package private) static java.lang.Object |
floatBinaryOperation(java.lang.Float F1,
java.lang.Float F2,
int kind)
|
(package private) static float |
floatUnaryOperation(java.lang.Float F,
int kind)
|
java.lang.Class |
getType()
|
private java.lang.Class |
getType(java.lang.Object o)
|
java.lang.Object |
getValue()
|
(package private) static java.lang.Object |
intBinaryOperation(java.lang.Integer I1,
java.lang.Integer I2,
int kind)
|
(package private) static int |
intUnaryOperation(java.lang.Integer I,
int kind)
|
int |
intValue()
|
boolean |
isNumber()
Determine if this primitive is a numeric type. |
(package private) static java.lang.Object |
longBinaryOperation(java.lang.Long L1,
java.lang.Long L2,
int kind)
|
(package private) static long |
longUnaryOperation(java.lang.Long L,
int kind)
|
java.lang.Number |
numberValue()
|
(package private) static java.lang.Object[] |
promotePrimitives(java.lang.Object lhs,
java.lang.Object rhs)
Promote the pair of primitives to the maximum type of the two. |
(package private) static java.lang.Object |
promoteToInteger(java.lang.Object primitive)
Promote primitive wrapper type to to Integer wrapper type Can we use the castPrimitive() (in BSHCastExpression) for this? |
java.lang.String |
toString()
|
static Primitive |
unaryOperation(Primitive val,
int kind)
|
static java.lang.Object |
unwrap(java.lang.Object obj)
Unwrap primitive values and map voids to nulls. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.lang.Object value
public static final Primitive NULL
public static final Primitive VOID
Constructor Detail |
private Primitive(java.lang.Object value)
public Primitive(java.lang.Number number)
public Primitive(java.lang.Boolean value)
public Primitive(java.lang.Byte value)
public Primitive(java.lang.Short value)
public Primitive(java.lang.Character value)
public Primitive(java.lang.Integer value)
public Primitive(java.lang.Long value)
public Primitive(java.lang.Float value)
public Primitive(java.lang.Double value)
public Primitive(boolean value)
public Primitive(byte value)
public Primitive(short value)
public Primitive(char value)
public Primitive(int value)
public Primitive(long value)
public Primitive(float value)
public Primitive(double value)
Method Detail |
public java.lang.Object getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Class getType()
private java.lang.Class getType(java.lang.Object o)
public static java.lang.Object binaryOperation(java.lang.Object obj1, java.lang.Object obj2, int kind) throws EvalError
EvalError
static java.lang.Object binaryOperationImpl(java.lang.Object lhs, java.lang.Object rhs, int kind) throws EvalError
EvalError
static java.lang.Boolean booleanBinaryOperation(java.lang.Boolean B1, java.lang.Boolean B2, int kind) throws EvalError
EvalError
static java.lang.Object longBinaryOperation(java.lang.Long L1, java.lang.Long L2, int kind)
static java.lang.Object intBinaryOperation(java.lang.Integer I1, java.lang.Integer I2, int kind)
static java.lang.Object doubleBinaryOperation(java.lang.Double D1, java.lang.Double D2, int kind) throws EvalError
EvalError
static java.lang.Object floatBinaryOperation(java.lang.Float F1, java.lang.Float F2, int kind) throws EvalError
EvalError
static java.lang.Object promoteToInteger(java.lang.Object primitive)
static java.lang.Object[] promotePrimitives(java.lang.Object lhs, java.lang.Object rhs)
public static Primitive unaryOperation(Primitive val, int kind) throws EvalError
EvalError
static boolean booleanUnaryOperation(java.lang.Boolean B, int kind) throws EvalError
EvalError
static int intUnaryOperation(java.lang.Integer I, int kind)
static long longUnaryOperation(java.lang.Long L, int kind)
static float floatUnaryOperation(java.lang.Float F, int kind)
static double doubleUnaryOperation(java.lang.Double D, int kind)
public int intValue() throws EvalError
EvalError
public boolean booleanValue() throws EvalError
EvalError
public boolean isNumber()
public java.lang.Number numberValue() throws EvalError
EvalError
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.lang.Object unwrap(java.lang.Object obj)
obj
- object type which may be bsh.Primitive
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |