next up previous contents
Next: Bank Numbers Up: Bank Names Previous: Initialization

Tests and Accessors

The general tests of validity and equality are provided. For example,

TRY_Bank_Name no_name ;    // default constructor puts it into invalid state
if (no_name.is_invalid())
  {  // yes, no_name is invalid
  }

TRY_Bank_Name LRID_name("LRID") ;
TRY_Bank_Name CMUO_name("CMUO") ;
if (LRID_name != CMUO_name)
  {  // Of course, they are not equal
  }

There are also tests for exactness (value is not a wildcard or special value) is_exact() and is_inexact() in TRY_Bank_Name. These methods are somewhat superfluous since there are no wildcards anymore in TRY_Bank_Name, but they are retained in case that situation changes. For now, bank names are always exact.

The internal value of the bank name can be accessed as a string with the as_string() method. For example,

cout << my_bank_name.as_string() ;

will output the four character sequence representing the bank name to cout.



Robert Kennedy
Mon Jul 28 13:23:28 CDT 1997