Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

AmericanExpress.java

Go to the documentation of this file.
00001 package net.threebit.utils.sosc ; 
00002 
00009 public class AmericanExpress extends CreditCard
00010 {    
00018     public AmericanExpress(final String americanexpress)
00019     {        
00020         super(americanexpress, "AmericanExpress");
00021     }
00022 
00031         public boolean equals(final Object o)
00032     {
00033        if (!(o instanceof AmericanExpress))
00034        {
00035            return (false);
00036        }
00037        return (super.equals(o));
00038     }
00039 
00046     protected boolean checkSize()
00047     {                
00048         return(15 == (number.length()));
00049     }
00050     
00058     protected boolean checkPrefix()
00059     {
00060         final int prefix;
00061         prefix = (((number.charAt(0) - '0') * 10) + (number.charAt(1) - '0')); 
00062         return ((prefix == 37) || (prefix == 34));
00063     }
00064     
00072     public static boolean validate(String num)
00073     {
00074          return(new AmericanExpress(num).validate());
00075     }
00076 }

Generated on Mon Jul 14 17:19:19 2003 for SOSC by doxygen1.2.15