postalcode
Class BritishPostalCode

java.lang.Object
  |
  +--postalcode.PostalCode
        |
        +--postalcode.BritishPostalCode

public class BritishPostalCode
extends PostalCode

This class is a subclass of PostalCode used to deal with British postal codes.


Fields inherited from class postalcode.PostalCode
code, destination, hasBeenValidated, isValid
 
Constructor Summary
BritishPostalCode(java.lang.String code)
          Constructs an instance of a British postal code object.
 
Method Summary
 java.lang.String getCountry()
          This method will return the country of origin of the postal code.
protected  void validate()
          This method will verify the validity of the postal code.
 
Methods inherited from class postalcode.PostalCode
getCode, getDestination, isValid, setDestination, throwException, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

BritishPostalCode

public BritishPostalCode(java.lang.String code)
                  throws PostalCodeException
Constructs an instance of a British postal code object.
Parameters:
code - The code to be analysed.
Method Detail

getCountry

public java.lang.String getCountry()
This method will return the country of origin of the postal code.
Returns:
A String containing the country of origin of this code.
Overrides:
getCountry in class PostalCode

validate

protected void validate()
                 throws PostalCodeException
This method will verify the validity of the postal code.
Throws:
PostalCodeException - If the code is found to be invalid.
Overrides:
validate in class PostalCode