A method and apparatus are disclosed that support multiple mobile address
types using object-oriented programming techniques. A mobile address
object class supports the creation of mobile address objects. The mobile
address object class includes the test-and-branch code that supports each
mobile address type. A CPA Mobile Address class allows mobile address
information to be stored in CPAMA objects in a uniform manner. The CPA
Mobile Address class provides the address retrieval functionality to map
the stored mobile address information to a suitable format. The CPAMA
class provides a set of constructors to create and initialize its data
members using an appropriate format, such as an access channel format or
an ANSI International Mobile Station Identifier format, and a set of
destructors to de-initialize objects before they are destroyed. The
address information can be extracted from a CPAMA object using a set of
member functions. Member functions to test equality and to assign one
mobile address object to another are also provided.