| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final Primitive | NULL
Hides bsh. |
| private Object | value
The primitive value stored in its java.lang wrapper class |
| public static final Primitive | VOID
Hides bsh. |
| pack-priv static Hashtable |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Object | binaryOperation(Object obj1, Object obj2, int kind)
Perform a binary operation on two Primitives or wrapper types. |
| pack-priv static Object | |
| pack-priv static Boolean | |
| pack-priv static boolean | |
| public boolean | |
| public static Class | |
| pack-priv static Primitive | castPrimitive(Class<T> toType, Class<T> fromType, Primitive fromValue, boolean checkOnly, int operation)
|
| public Primitive | castToType(Class<T>
is the java object or primitive TYPE class toType, int operation)Cast this bsh.Primitive value to a new bsh.Primitive value This is usually a numeric type cast. |
| pack-priv static Object | castWrapper(Class<T>
is the java TYPE type toType, Object is the value in java.lang wrapper.
value may not be null. value)Cast a primitive value represented by its java.lang wrapper type to the specified java.lang wrapper type. |
| pack-priv static Object | |
| pack-priv static double | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| pack-priv static Object | |
| pack-priv static float | |
| public static Primitive | |
| public Class | Returns: the primitive TYPE class type of the value or Void.TYPE for Primitive.VOID or null value for type of Primitive.NULLGet the corresponding Java primitive TYPE class for this Primitive. |
| public Object | |
| public int | hashCode()
Overrides java. |
| pack-priv static Object | |
| pack-priv static int | |
| public int | |
| public boolean | |
| public static boolean | |
| pack-priv static Object | |
| pack-priv static long | |
| public Number | |
| pack-priv static Object[] | promotePrimitives(Object lhs, Object rhs)
Promote the pair of primitives to the maximum type of the two. |
| pack-priv static Object | |
| public String | |
| public static Primitive | |
| public static Class | |
| public static Object | |
| public static Object[] | |
| public static Object[] | |
| public static Object |
| NULL | back to summary |
|---|---|
| public static final Primitive NULL Hides bsh. | |
| value | back to summary |
|---|---|
| private Object value The primitive value stored in its java.lang wrapper class | |
| VOID | back to summary |
|---|---|
| public static final Primitive VOID Hides bsh. 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. | |
| wrapperMap | back to summary |
|---|---|
| pack-priv static Hashtable<K, V> wrapperMap | |
| Primitive | back to summary |
|---|---|
| public Primitive(Object value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(boolean value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(byte value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(short value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(char value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(int value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(long value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(float value) | |
| Primitive | back to summary |
|---|---|
| public Primitive(double value) | |
| binaryOperation | back to summary |
|---|---|
| public static Object binaryOperation(Object obj1, Object obj2, int kind) throws UtilEvalError Perform 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 either way. | |
| binaryOperationImpl | back to summary |
|---|---|
| pack-priv static Object binaryOperationImpl(Object lhs, Object rhs, int kind) throws UtilEvalError | |
| booleanBinaryOperation | back to summary |
|---|---|
| pack-priv static Boolean booleanBinaryOperation(Boolean B1, Boolean B2, int kind) | |
| booleanUnaryOperation | back to summary |
|---|---|
| pack-priv static boolean booleanUnaryOperation(Boolean B, int kind) throws UtilEvalError | |
| booleanValue | back to summary |
|---|---|
| public boolean booleanValue() throws UtilEvalError | |
| boxType | back to summary |
|---|---|
| public static Class Get the corresponding java.lang wrapper class for the primitive TYPE class. e.g. Integer.TYPE -> Integer.class | |
| castPrimitive | back to summary |
|---|---|
| pack-priv static Primitive castPrimitive(Class<T> toType, Class<T> fromType, Primitive fromValue, boolean checkOnly, int operation) throws UtilEvalError | |
| castToType | back to summary |
|---|---|
| public Primitive castToType(Class<T> toType, int operation) throws UtilEvalError Cast this bsh.Primitive value to a new bsh.Primitive value This is usually a numeric type cast. Other cases include: A boolean can be cast to boolen null can be cast to any object type and remains null Attempting to cast a void causes an exception
| |
| castWrapper | back to summary |
|---|---|
| pack-priv static Object castWrapper(Class<T> toType, Object value) Cast a primitive value represented by its java.lang wrapper type to the specified java.lang wrapper type. e.g. Byte(5) to Integer(5) or Integer(5) to Byte(5) | |
| doubleBinaryOperation | back to summary |
|---|---|
| pack-priv static Object doubleBinaryOperation(Double D1, Double D2, int kind) throws UtilEvalError | |
| doubleUnaryOperation | back to summary |
|---|---|
| pack-priv static double doubleUnaryOperation(Double D, int kind) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Primitives compare equal with other Primitives containing an equal wrapped value.
| |
| floatBinaryOperation | back to summary |
|---|---|
| pack-priv static Object floatBinaryOperation(Float F1, Float F2, int kind) throws UtilEvalError | |
| floatUnaryOperation | back to summary |
|---|---|
| pack-priv static float floatUnaryOperation(Float F, int kind) | |
| getDefaultValue | back to summary |
|---|---|
| public static Primitive getDefaultValue(Class<T> type) Get the appropriate default value per JLS 4.5.4 | |
| getType | back to summary |
|---|---|
| public Class Get the corresponding Java primitive TYPE class for this Primitive.
| |
| getValue | back to summary |
|---|---|
| public Object getValue() Return the primitive value stored in its java.lang wrapper class | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. The hash of the Primitive is tied to the hash of the wrapped value but shifted so that they are not the same.
| |
| intBinaryOperation | back to summary |
|---|---|
| pack-priv static Object intBinaryOperation(Integer I1, Integer I2, int kind) | |
| intUnaryOperation | back to summary |
|---|---|
| pack-priv static int intUnaryOperation(Integer I, int kind) | |
| intValue | back to summary |
|---|---|
| public int intValue() throws UtilEvalError | |
| isNumber | back to summary |
|---|---|
| public boolean isNumber() Determine if this primitive is a numeric type. i.e. not boolean, null, or void (but including char) | |
| isWrapperType | back to summary |
|---|---|
| public static boolean isWrapperType(Class<T> type) | |
| longBinaryOperation | back to summary |
|---|---|
| pack-priv static Object longBinaryOperation(Long L1, Long L2, int kind) | |
| longUnaryOperation | back to summary |
|---|---|
| pack-priv static long longUnaryOperation(Long L, int kind) | |
| numberValue | back to summary |
|---|---|
| public Number numberValue() throws UtilEvalError | |
| promotePrimitives | back to summary |
|---|---|
| pack-priv static Object[] promotePrimitives(Object lhs, Object rhs) Promote the pair of primitives to the maximum type of the two. e.g. [int,long]->[long,long] | |
| promoteToInteger | back to summary |
|---|---|
| pack-priv static Object promoteToInteger(Object wrapper) Promote primitive wrapper type to to Integer wrapper type | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
| unaryOperation | back to summary |
|---|---|
| public static Primitive unaryOperation(Primitive val, int kind) throws UtilEvalError | |
| unboxType | back to summary |
|---|---|
| public static Class Get the corresponding primitive TYPE class for the java.lang wrapper class type. e.g. Integer.class -> Integer.TYPE | |
| unwrap | back to summary |
|---|---|
| public static Object unwrap(Object obj) Unwrap primitive values and map voids to nulls. Non Primitive types remain unchanged. | |
| unwrap | back to summary |
|---|---|
| public static Object[] unwrap(Object[] args) | |
| wrap | back to summary |
|---|---|
| public static Object[] wrap(Object[] args, Class<T>[] paramTypes) | |
| wrap | back to summary |
|---|---|
| public static Object wrap(Object value, Class<T> type) Wrap primitive values (as indicated by type param) and nulls in the Primitive class. Values not primitive or null are left unchanged. Primitive values are represented by their wrapped values in param value. The value null is mapped to Primitive.NULL. Any value specified with type Void.TYPE is mapped to Primitive.VOID. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Primitive. | |
| public static final Primitive. |
| Access | Constructor and Description |
|---|---|
| private |
| NULL_VALUE | back to summary |
|---|---|
| public static final Primitive. | |
| VOID_TYPE | back to summary |
|---|---|
| public static final Primitive. | |
| Special | back to summary |
|---|---|
| private Special() | |