Inheritance diagram for sosc::Validatable:

Public Methods | |
| String | getNumber () |
| String | getType () |
| String | toString () |
| boolean | equals (Object o) |
| final boolean | validate () |
Protected Methods | |
| Validatable (final String num, final String typ) | |
| boolean | checkPrefix () |
| abstract boolean | checkSize () |
| abstract boolean | checkDigits (int[] digits) |
Protected Attributes | |
| final String | number |
Private Attributes | |
| final String | type |
| boolean | isValid |
| boolean | validated |
Definition at line 8 of file Validatable.java.
|
||||||||||||
|
Validatable sets the values of the number and type fields
Definition at line 68 of file Validatable.java. References sosc::Validatable::number, and sosc::Validatable::type. |
|
|
Referenced by sosc::Validatable::validate(). |
|
|
Code for checkPrefix() is only provided here as a default for the classes that don't require the checkPrefix() method such as SIN or UPC. Any class that inherites this method will override it if it needs it.
Reimplemented in sosc::AmericanExpress, sosc::MasterCard, and sosc::Visa. Definition at line 120 of file Validatable.java. Referenced by sosc::Validatable::validate(). |
|
|
The implementation of checkSize() and checkDigits is most likely going to be different for any classes that inherit from Validatable. However, any class that inherits from Validatable will probably have them in some way; thus, they have been provided here as abstracts. Implemented in sosc::AmericanExpress, sosc::ISBN, sosc::MasterCard, sosc::SIN, sosc::UPC, and sosc::Visa. Referenced by sosc::Validatable::validate(). |
|
|
The equals method checks to see if the object passed in is equal to the current object.
Reimplemented in sosc::ISBN, sosc::SIN, and sosc::UPC. Definition at line 80 of file Validatable.java. References sosc::Validatable::number. |
|
|
getNumber() returns the value stored in the private number field
Definition at line 37 of file Validatable.java. References sosc::Validatable::number. |
|
|
getType() returns the value stored in the private type field
Definition at line 47 of file Validatable.java. References sosc::Validatable::type. |
|
|
toString() returns the value in the number field
Definition at line 57 of file Validatable.java. References sosc::Validatable::number. |
|
|
The validate method checks to see if the value stored in the number field is a valid number of the related type.
Definition at line 94 of file Validatable.java. References sosc::Validatable::checkDigits(), sosc::Validatable::checkPrefix(), sosc::Validatable::checkSize(), sosc::Validatable::isValid, sosc::Validatable::number, and sosc::Validatable::validated. |
|
|
Holds the result returned by the validate() method Definition at line 23 of file Validatable.java. Referenced by sosc::Validatable::validate(). |
|
|
Holds the number related to the Validatable instance Definition at line 18 of file Validatable.java. Referenced by sosc::UPC::checkDigits(), sosc::SIN::checkDigits(), sosc::ISBN::checkDigits(), sosc::CreditCard::checkDigits(), sosc::Visa::checkPrefix(), sosc::MasterCard::checkPrefix(), sosc::AmericanExpress::checkPrefix(), sosc::Visa::checkSize(), sosc::UPC::checkSize(), sosc::SIN::checkSize(), sosc::MasterCard::checkSize(), sosc::ISBN::checkSize(), sosc::AmericanExpress::checkSize(), sosc::Validatable::equals(), sosc::Validatable::getNumber(), sosc::Validatable::toString(), sosc::Validatable::Validatable(), and sosc::Validatable::validate(). |
|
|
Holds the name/type of the Validatable instance Definition at line 13 of file Validatable.java. Referenced by sosc::Validatable::getType(), and sosc::Validatable::Validatable(). |
|
|
Set to true after the first time the validate() method is run on an object. Definition at line 29 of file Validatable.java. Referenced by sosc::Validatable::validate(). |
1.2.15