Class ValidState

java.lang.Object
  extended by ValidState

public class ValidState
extends java.lang.Object

The ValidState class definition validates state abbreviations entered by users.

Version:
Copyright 2002 (c) SCCC West
Author:
Carl B. Struck

Constructor Summary
ValidState(java.lang.String state)
          The constructor sets initial value for the state abbreviation.
 
Method Summary
 java.lang.String getState()
          Returns the state abbreviation field as a String
 void setState(java.lang.String state)
          Sets value for state abbreviation field which must be from the list of 50 valid state abbreviations or the District of Columbia (DC).
 java.lang.String toString()
          Returns a String representation of the ValidState class which is the formatted state abbreviation field with a preceding label.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidState

public ValidState(java.lang.String state)
The constructor sets initial value for the state abbreviation.

Parameters:
state - the state abbreviation
Method Detail

getState

public java.lang.String getState()
Returns the state abbreviation field as a String

Returns:
state abbreviation

setState

public void setState(java.lang.String state)
Sets value for state abbreviation field which must be from the list of 50 valid state abbreviations or the District of Columbia (DC).

Parameters:
state - the state abbreviation

toString

public java.lang.String toString()
Returns a String representation of the ValidState class which is the formatted state abbreviation field with a preceding label.

Overrides:
toString in class java.lang.Object
Returns:
formatted first name, last name, grade and credits fields with labels as a String.