org.netbeans.microedition.databinding.el
Class Coercions

java.lang.Object
  extended by org.netbeans.microedition.databinding.el.Coercions

public class Coercions
extends java.lang.Object

This class contains the logic for coercing data types before operators are applied to them.

The following is the list of rules applied for various type conversions.


Constructor Summary
Coercions()
           
 
Method Summary
static java.lang.Object applyArithmeticOperator(java.lang.Object pLeft, java.lang.Object pRight, int pOperator, Logger pLogger)
          Performs all of the necessary type conversions, then calls on the appropriate operator.
static java.lang.Boolean applyEqualityOperator(java.lang.Object pLeft, java.lang.Object pRight, int pOperator, Logger pLogger)
          Performs all of the necessary type conversions, then calls on the appropriate operator.
static java.lang.Boolean applyRelationalOperator(java.lang.Object pLeft, java.lang.Object pRight, int pOperator, Logger pLogger)
          Performs all of the necessary type conversions, then calls on the appropriate operator.
static java.lang.Boolean coerceObjectToBoolean(java.lang.Object pValue, Logger pLogger)
          Coerces a value to a Boolean
static java.lang.Object coerceObjectToPrimitiveNumber(java.lang.Object pValue, java.lang.Class pClass, Logger pLogger)
          Coerces a value to the given primitive number class
static double doubleValue(java.lang.Object object)
           
static boolean isFloatingPointString(java.lang.Object pObject)
          Returns true if the given string might contain a floating point number - i.e., it contains ".", "e", or "E"
static boolean isFloatingPointType(java.lang.Object pObject)
          Returns true if the given Object is of a floating point type
static long longValue(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Coercions

public Coercions()
Method Detail

coerceObjectToPrimitiveNumber

public static java.lang.Object coerceObjectToPrimitiveNumber(java.lang.Object pValue,
                                                             java.lang.Class pClass,
                                                             Logger pLogger)
Coerces a value to the given primitive number class


coerceObjectToBoolean

public static java.lang.Boolean coerceObjectToBoolean(java.lang.Object pValue,
                                                      Logger pLogger)
Coerces a value to a Boolean


applyArithmeticOperator

public static java.lang.Object applyArithmeticOperator(java.lang.Object pLeft,
                                                       java.lang.Object pRight,
                                                       int pOperator,
                                                       Logger pLogger)
Performs all of the necessary type conversions, then calls on the appropriate operator.


applyRelationalOperator

public static java.lang.Boolean applyRelationalOperator(java.lang.Object pLeft,
                                                        java.lang.Object pRight,
                                                        int pOperator,
                                                        Logger pLogger)
Performs all of the necessary type conversions, then calls on the appropriate operator.


applyEqualityOperator

public static java.lang.Boolean applyEqualityOperator(java.lang.Object pLeft,
                                                      java.lang.Object pRight,
                                                      int pOperator,
                                                      Logger pLogger)
Performs all of the necessary type conversions, then calls on the appropriate operator.


longValue

public static long longValue(java.lang.Object object)

doubleValue

public static double doubleValue(java.lang.Object object)

isFloatingPointType

public static boolean isFloatingPointType(java.lang.Object pObject)
Returns true if the given Object is of a floating point type


isFloatingPointString

public static boolean isFloatingPointString(java.lang.Object pObject)
Returns true if the given string might contain a floating point number - i.e., it contains ".", "e", or "E"