Here you can find the source of isNumeric(Class operandClass)
Parameter | Description |
---|---|
operandClass | the class type of the numeric operand |
public static boolean isNumeric(Class operandClass)
//package com.java2s; //License from project: Apache License import java.util.HashMap; import java.util.Map; public class Main { private static Map primitiveLangClassMap = new HashMap(); /**// ww w . ja va 2 s . c o m * Determine whether the operand of type operandClass can be a numeric * operand * * @param operandClass * the class type of the numeric operand * @return whether the operand of type operand Class can be a numeric * operand */ public static boolean isNumeric(Class operandClass) { if (operandClass == null || !operandClass.isPrimitive() || operandClass == boolean.class || operandClass == void.class) { if (primitiveLangClassMap.containsKey(operandClass)) { return true; } return false; } return true; } }