@Test public void testIsNumber() { assertFalse( CreditCardVerifier.isNumber( "" ) ); assertFalse( CreditCardVerifier.isNumber( "a" ) ); assertTrue( CreditCardVerifier.isNumber( "1" ) ); assertTrue( CreditCardVerifier.isNumber( "1.01" ) ); }
public static boolean isNumber( String n ) { try { Double.valueOf( n ).doubleValue(); return true; } catch ( NumberFormatException e ) { return false; } }
CreditCardVerifier { public static boolean isNumber( String n ) { try { Double.valueOf( n ).doubleValue(); return true; } catch ( NumberFormatException e ) { return false; } } }
CreditCardVerifier { public static boolean isNumber( String n ) { try { Double.valueOf( n ).doubleValue(); return true; } catch ( NumberFormatException e ) { return false; } }  }
CreditCardVerifier { public static boolean isNumber( String n ) { try { Double.valueOf( n ).doubleValue(); return true; } catch ( NumberFormatException e ) { return false; } }  static String getCardName( int id ); static String getNotValidCardNames( int id ); static ReturnIndicator CheckCC( String CardNumber ); static boolean luhnValidate( String numberString ); static int getCardID( String number ); static boolean isNumber( String n ); }
CreditCardVerifier { public static boolean isNumber( String n ) { try { Double.valueOf( n ).doubleValue(); return true; } catch ( NumberFormatException e ) { return false; } }  static String getCardName( int id ); static String getNotValidCardNames( int id ); static ReturnIndicator CheckCC( String CardNumber ); static boolean luhnValidate( String numberString ); static int getCardID( String number ); static boolean isNumber( String n ); static final int INVALID; static final int VISA; static final int MASTERCARD; static final int AMERICAN_EXPRESS; static final int EN_ROUTE; static final int DINERS_CLUB; static final int DISCOVER; static final int JCB1; static final int JCB2; static final int BANKCARD; static final int MAESTRO; static final int SOLO; static final int SWITCH; static final int AIRPLUS; static final int LASER; static final int VOYAGER; }