|
|||||||||||
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.
Field Summary | |
static Primitive |
NULL
|
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)
|
|
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)
Perform a binary operation on two Primitives or wrapper types. |
boolean |
booleanValue()
|
boolean |
equals(java.lang.Object obj)
Primitives compare equal with other Primitives containing an equal wrapped value. |
static Primitive |
getDefaultValue(java.lang.Class type)
Get the appropriate default value per JLS 4.5.4 |
java.lang.Class |
getType()
Get the corresponding primitive TYPE class for the Primitive |
java.lang.Object |
getValue()
Return the primitive value stored in its java.lang wrapper class |
int |
hashCode()
The hash of the Primitive is tied to the hash of the wrapped value but shifted so that they are not the same. |
int |
intValue()
|
boolean |
isNumber()
Determine if this primitive is a numeric type. |
java.lang.Number |
numberValue()
|
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, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Primitive NULL
public static final Primitive VOID
Constructor Detail |
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()
public static java.lang.Object binaryOperation(java.lang.Object obj1, java.lang.Object obj2, int kind) throws UtilEvalError
UtilEvalError
public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError
UtilEvalError
public int intValue() throws UtilEvalError
UtilEvalError
public boolean booleanValue() throws UtilEvalError
UtilEvalError
public boolean isNumber()
public java.lang.Number numberValue() throws UtilEvalError
UtilEvalError
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static java.lang.Object unwrap(java.lang.Object obj)
obj
- object type which may be bsh.Primitive
public static Primitive getDefaultValue(java.lang.Class type)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |