com.objectxp.msg
Class GsmAddress

java.lang.Object
  extended bycom.objectxp.msg.Address
      extended bycom.objectxp.msg.GsmAddress
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class GsmAddress
extends Address
implements java.lang.Cloneable, java.io.Serializable

This class represents a GSM Address field according to GSM 03.40.

A GSM address consist of 3 fields:

Since:
jSMS 1.6.2
See Also:
Serialized Form

Field Summary
static byte NPI_ERMES
          Numbering plan: ERMES (ETSI DE/PS3 01-3)
static byte NPI_NATIONAL
          Numbering plan: National
static byte NPI_PHONE
          Numbering plan: ISDN/telephone (E.164/E.163)
static byte NPI_PRIVATE
          Numbering plan: Private
static byte NPI_TELEX
          Numbering plan: Telex (F.69)
static byte NPI_UNKNOWN
          Numbering plan: Unknown
static byte NPI_X121
          Numbering plan: Data (X.121)
static byte TON_ABBREVIATED
          Type of number: Abbreviated
static byte TON_ALPHANUMERIC
          Type of number: Alphanumeric
static byte TON_INTERNATIONAL
          Type of number: International
static byte TON_NATIONAL
          Type of number: National
static byte TON_NETWORK_SPECIFIC
          Type of number: Network specific
static byte TON_SUBSCRIBER_NUMBER
          Type of number: Subscriber number
static byte TON_UNKNOWN
          Type of number: Unknown
 
Constructor Summary
GsmAddress(java.lang.String address)
          Construct a new GsmAddress.
GsmAddress(java.lang.String address, byte TON, byte NPI)
          Construct a new GsmAddress.
 
Method Summary
 byte getNPI()
          Returns the Numbering-plan-identification (NPI).
 byte getTON()
          Returns the type of Number (TON).
 java.lang.String toString()
          Returns a string representation of the address.
 
Methods inherited from class com.objectxp.msg.Address
equals, getAddress
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TON_UNKNOWN

public static final byte TON_UNKNOWN
Type of number: Unknown

See Also:
Constant Field Values

TON_INTERNATIONAL

public static final byte TON_INTERNATIONAL
Type of number: International

See Also:
Constant Field Values

TON_NATIONAL

public static final byte TON_NATIONAL
Type of number: National

See Also:
Constant Field Values

TON_NETWORK_SPECIFIC

public static final byte TON_NETWORK_SPECIFIC
Type of number: Network specific

See Also:
Constant Field Values

TON_SUBSCRIBER_NUMBER

public static final byte TON_SUBSCRIBER_NUMBER
Type of number: Subscriber number

See Also:
Constant Field Values

TON_ALPHANUMERIC

public static final byte TON_ALPHANUMERIC
Type of number: Alphanumeric

See Also:
Constant Field Values

TON_ABBREVIATED

public static final byte TON_ABBREVIATED
Type of number: Abbreviated

See Also:
Constant Field Values

NPI_UNKNOWN

public static final byte NPI_UNKNOWN
Numbering plan: Unknown

See Also:
Constant Field Values

NPI_PHONE

public static final byte NPI_PHONE
Numbering plan: ISDN/telephone (E.164/E.163)

See Also:
Constant Field Values

NPI_X121

public static final byte NPI_X121
Numbering plan: Data (X.121)

See Also:
Constant Field Values

NPI_TELEX

public static final byte NPI_TELEX
Numbering plan: Telex (F.69)

See Also:
Constant Field Values

NPI_NATIONAL

public static final byte NPI_NATIONAL
Numbering plan: National

See Also:
Constant Field Values

NPI_PRIVATE

public static final byte NPI_PRIVATE
Numbering plan: Private

See Also:
Constant Field Values

NPI_ERMES

public static final byte NPI_ERMES
Numbering plan: ERMES (ETSI DE/PS3 01-3)

See Also:
Constant Field Values
Constructor Detail

GsmAddress

public GsmAddress(java.lang.String address)
Construct a new GsmAddress. The Numbering-plan-identification (NPI) will be set to NPI_PHONE. If the address contains non-numeric characters, the type of number (TON) will be set to TON_ALPHANUMERIC. Otherwise, if the address starts with a leading '+', the TON is set to TON_INTERNATIONAL if no leading '+' is present, the TON is set to TON_UNKNOWN.

Parameters:
address - the Address (e.g. "+4179123456")

GsmAddress

public GsmAddress(java.lang.String address,
                  byte TON,
                  byte NPI)
           throws java.lang.IllegalArgumentException
Construct a new GsmAddress.

Parameters:
address - the address.
TON - type of Number (TON)
NPI - Numbering-plan-identification (NPI).
Throws:
java.lang.IllegalArgumentException - if address is null.
Method Detail

getNPI

public byte getNPI()
Returns the Numbering-plan-identification (NPI).


getTON

public byte getTON()
Returns the type of Number (TON).


toString

public java.lang.String toString()
Description copied from class: Address
Returns a string representation of the address.

Overrides:
toString in class Address


object XP, Inc. © 2000-2007. All rights reserved object XP