org.marre.sms
Class SmsAddress

java.lang.Object
  extended byorg.marre.sms.SmsAddress

public class SmsAddress
extends java.lang.Object

Represents an phonenumber in SMSj.

The address can be a phonenumber (+463482422) or alphanumeric ('SmsService'). Not all networks and transports supports alphanumeric sending id.

Max address length is
- 20 digits (excluding any initial '+') or
- 11 alphanumeric chars (if TON == TON_ALPHANUMERIC).

Look in SmsConstants for definitions of TON and NPI.

Version:
$Id: SmsAddress.java,v 1.7 2004/11/02 17:59:49 c95men Exp $
Author:
Markus Eriksson

Constructor Summary
SmsAddress(java.lang.String theAddress)
          Creates an SmsAddress object.
SmsAddress(java.lang.String theAddress, int theTon, int theNpi)
          Creates an SmsAddress object.
 
Method Summary
 java.lang.String getAddress()
          Returns the address
 int getNumberingPlanIdentification()
          Returns the NPI field See SmsConstants for definitions of different TON:s
 int getTypeOfNumber()
          Returns the TON field See SmsConstants for definitions of different TON:s
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmsAddress

public SmsAddress(java.lang.String theAddress)
           throws SmsException
Creates an SmsAddress object.

This constructor tries to be intelligent by choosing the correct NPI and TON from the given address.

Parameters:
theAddress - The address
Throws:
SmsException - Thrown if the address is invalid

SmsAddress

public SmsAddress(java.lang.String theAddress,
                  int theTon,
                  int theNpi)
           throws SmsException
Creates an SmsAddress object.

If you choose TON_ALPHANUMERIC then the NPI will be set to NPI_UNKNOWN.

Parameters:
theAddress - The address
theTon - The type of number
theNpi - The number plan indication
Throws:
SmsException - Thrown if the address is invalid
Method Detail

getAddress

public java.lang.String getAddress()
Returns the address

Returns:
The address

getTypeOfNumber

public int getTypeOfNumber()
Returns the TON field

See SmsConstants for definitions of different TON:s

Returns:
The TON

getNumberingPlanIdentification

public int getNumberingPlanIdentification()
Returns the NPI field

See SmsConstants for definitions of different TON:s

Returns:
The NPI


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.