Inheritance diagram for sosc::UPC:

Public Methods | |
| UPC (final String upc) | |
| boolean | equals (Object o) |
Static Public Methods | |
| boolean | validate (String num) |
Protected Methods | |
| boolean | checkDigits (final int[] digits) |
| boolean | checkSize () |
Definition at line 8 of file UPC.java.
|
|
The constructor for UCP calls the cunstructor from Validatable in order to set the number and type field values.
Definition at line 17 of file UPC.java. Referenced by sosc::UPC::validate(). |
|
|
checkDigits() performs the actual validation algorithm. For a an english version of the algorithm go to the following link: http://www.cs.queensu.ca/home/bradbury/checkdigit/
Definition at line 48 of file UPC.java. References sosc::Validatable::number. |
|
|
checkSize() is used to check that the number being validated has the correct number digits for its type.
Implements sosc::Validatable. Definition at line 103 of file UPC.java. References sosc::Validatable::number. |
|
|
The equals method checks to see if the object passed in is an instance of this class. If it is an instance, the equals method from the Validatable class is called.
Reimplemented from sosc::Validatable. |
|
|
The static validate method creates a new object and calls the instance validate() method.
Definition at line 92 of file UPC.java. References sosc::UPC::UPC(). |
1.2.15