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

Visa.java

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

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