static Number coerceToPrimitiveNumber ( Number pValue , Class pClass ) throws ELException { if ( pClass == Byte . class || pClass == Byte . TYPE ) { return PrimitiveObjects . getByte ( pValue . byteValue ( ) ) ; } else if ( pClass == Short . class || pClass == Short . TYPE ) { return PrimitiveObjects . getShort ( pValue . shortValue ( ) ) ; } else if ( pClass == Integer . class || pClass == Integer . TYPE ) { return PrimitiveObjects . getInteger ( pValue . intValue ( ) ) ; } else if ( pClass == Long . class || pClass == Long . TYPE ) { return PrimitiveObjects . getLong ( pValue . longValue ( ) ) ; } else if ( pClass == Float . class || pClass == Float . TYPE ) { return PrimitiveObjects . getFloat ( pValue . floatValue ( ) ) ; } else if ( pClass == Double . class || pClass == Double . TYPE ) { return PrimitiveObjects . getDouble ( pValue . doubleValue ( ) ) ; } else { return PrimitiveObjects . getInteger ( 0 ) ; } }
Coerces a Number to the given primitive number class