Here you can find the source of isNumericType(Class aNumberClass)
public static boolean isNumericType(Class aNumberClass)
//package com.java2s; /******************************************************************************* * Copyright 2000, 2006 Visual Systems Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License version 2 * which accompanies this distribution in a file named "COPYING". * // w ww. j av a 2s.c om * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *******************************************************************************/ import java.util.HashMap; import java.util.Map; public class Main { /** Key is a Number Class, Value is an Integer indicating rank. */ private static final Map<Class<?>, Integer> NUMBER_RANK_MAP = new HashMap<Class<?>, Integer>(); /** * Determines if the given class is numeric. * * @return true if the given class is derived from Number. */ public static boolean isNumericType(Class aNumberClass) { return NUMBER_RANK_MAP.get(aNumberClass) != null; } }