| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectbsh.PrimitiveConstructor Summary | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Method Summary | |
static Object |
|
boolean | |
boolean |
|
static Primitive |
|
Class |
|
Object |
|
int |
|
int |
|
boolean |
|
Number | |
String |
|
static Primitive |
|
static Object |
|
public static final Primitive VOID
VOID means "no type". Strictly speaking, this makes no sense here. But for practical reasons we'll consider the lack of a type to be a special value.
public Primitive(Boolean value)
public Primitive(Byte value)
public Primitive(Character value)
public Primitive(Double value)
public Primitive(Float value)
public Primitive(Integer value)
public Primitive(Long value)
public Primitive(Number number)
public Primitive(Short value)
public Primitive(boolean value)
public Primitive(byte value)
public Primitive(char value)
public Primitive(double value)
public Primitive(float value)
public Primitive(int value)
public Primitive(long value)
public Primitive(short value)
public static Object binaryOperation(Object obj1,
Object obj2,
int kind)
throws UtilEvalErrorPerform a binary operation on two Primitives or wrapper types. If both original args were Primitives return a Primitive result else it was mixed (wrapper/primitive) return the wrapper type. The exception is for boolean operations where we will return the primitive type eithe way.
public boolean equals(Object obj)
Primitives compare equal with other Primitives containing an equal wrapped value.
public static Primitive getDefaultValue(Class type)
Get the appropriate default value per JLS 4.5.4
public Class getType()
Get the corresponding primitive TYPE class for the Primitive
- Returns:
- the primitive TYPE class type of the value or Void.TYPE for Primitive.VOID or null value for type of Primitive.NULL
public Object getValue()
Return the primitive value stored in its java.lang wrapper class
public 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.
public boolean isNumber()
Determine if this primitive is a numeric type. i.e. not boolean, null, or void (but including char)
public String toString()
public static Object unwrap(Object obj)
Unwrap primitive values and map voids to nulls. Normal (non Primitive) types remain unchanged.
- Parameters:
obj- object type which may be bsh.Primitive
- Returns:
- corresponding "normal" Java type, "unwrapping" any bsh.Primitive types to their wrapper types.