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

sosc::SIN Class Reference

Inheritance diagram for sosc::SIN:

sosc::Validatable List of all members.

Public Methods

 SIN (final String sin)
boolean equals (Object o)

Static Public Methods

boolean validate (String num)

Protected Methods

boolean checkDigits (final int[] digits)
boolean checkSize ()

Detailed Description

The SIN class contains methods for comparing and validating SIN numbers.

Author:
Brad Johnson, Set E, ID# A00253700

Definition at line 8 of file SIN.java.


Constructor & Destructor Documentation

sosc::SIN::SIN final String    sin [inline]
 

The constructor for SIN calls the cunstructor from Validatable in order to set the number and type field values.

Parameters:
sin  the number to be validated, in String form
Returns:
none

Definition at line 17 of file SIN.java.

Referenced by sosc::SIN::validate().


Member Function Documentation

boolean sosc::SIN::checkDigits final int    digits[] [inline, protected]
 

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/

Parameters:
digits  [] an array of the digits in the number to be validated
Returns:
the result of the validation

Definition at line 60 of file SIN.java.

References sosc::Validatable::number.

boolean sosc::SIN::checkSize   [inline, protected, virtual]
 

checkSize() is used to check that the number being validated has the correct number digits for its type.

Returns:
true or false is returned based on the result of the size check.

Implements sosc::Validatable.

Definition at line 106 of file SIN.java.

References sosc::Validatable::number.

boolean sosc::SIN::equals Object    o [inline]
 

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.

Parameters:
o  the object to be compared against
Returns:
the result of the comparison

Reimplemented from sosc::Validatable.

Definition at line 30 of file SIN.java.

boolean sosc::SIN::validate String    num [inline, static]
 

The static validate method creates a new object and calls the instance validate() method.

Parameters:
str  the number to be validated in String form
Returns:
the result of the validation

Definition at line 46 of file SIN.java.

References sosc::SIN::SIN().


The documentation for this class was generated from the following file:
Generated on Mon Jul 14 17:19:22 2003 for SOSC by doxygen1.2.15