FileDocCategorySizeDatePackage
TelephoneNumber.javaAPI DocphoneME MR2 API (J2ME)5866Wed May 02 18:00:42 BST 2007gov.nist.siplite.address

TelephoneNumber

public class TelephoneNumber extends GenericObject
Telephone number class.
version
JAIN-SIP-1.1 This code is in the public domain.

Fields Summary
public static final String
POSTDIAL
Post dial method string.
public static final String
PHONE_CONTEXT_TAG
Phone context tag string.
public static final String
ISUB
ISDN subaddress parameter label.
public static final String
PROVIDER_TAG
Provider tag label.
protected boolean
isglobal
Flag indicating international phone number.
protected String
phoneNumber
Phone number field.
protected NameValueList
parms
Parmeters list.
Constructors Summary
public TelephoneNumber()
Creates new TelephoneNumber.


            
      
        parms = new NameValueList("telparms");
    
Methods Summary
public java.lang.Objectclone()
Copies the current object.

return
copy of current instance

        TelephoneNumber retval = new TelephoneNumber();
        retval.isglobal = this.isglobal;
        retval.phoneNumber = new String(this.phoneNumber);
        retval.parms = (NameValueList)this.parms.clone();
        return retval;
    
public voiddeleteParm(java.lang.String name)
Deletes the specified parameter.

param
name String to set

        parms.delete(name);
    
public java.lang.Stringencode()
( Encodes instance contents as a string.

return
encoded string of object contents

        String retval = "";
        if (isglobal) retval += "+";
        retval += phoneNumber;
        if (! parms.isEmpty()) {
            retval += Separators.SEMICOLON;
            retval += parms.encode();
        }
        return retval;
    
public java.lang.StringgetIsdnSubaddress()
Get the isdn subaddress for this number.

return
String

        return (String) parms.getValue(ISUB);
    
public java.lang.StringgetPhoneNumber()
Gets the PhoneNumber field.

return
the phone number

        return phoneNumber;
    
public java.lang.StringgetPostDial()
Gets the PostDial field.

return
String

        return (String) parms.getValue(POSTDIAL);
    
public booleanhasIsdnSubaddress()
Returns true if the isdn subaddress exists.

return
True if isdn sub address exists.

        return hasParm(ISUB);
    
public booleanhasParm(java.lang.String pname)
Returns true if this header has parameters.

param
pname String to set
return
true if parameter is present

        return parms.hasNameValue(pname);
    
public booleanhasPostDial()
Returns true if the PostDial field exists.

return
true if post dial field is included

        return parms.getValue(POSTDIAL) != null;
    
public booleanisGlobal()
Returns tru if telephone number is a global telephone number.

return
true if global phone number

        return isglobal;
    
public voidremoveIsdnSubaddress()
Removes the isdn subaddress (if it exists).

        deleteParm(ISUB);
    
public voidremovePostDial()
Removes the PostDial field.

        parms.delete(POSTDIAL);
    
public voidsetGlobal(boolean g)
Sets the Global field.

param
g boolean to set

        isglobal = g;
    
public voidsetIsdnSubaddress(java.lang.String isub)
Sets the isdn subaddress for this structure.

param
isub String to set

        setParm(ISUB, isub);
    
public voidsetParameters(NameValueList p)
Sets the list of parameters.

param
p NameValueList to set

        parms = p;
    
public voidsetParm(java.lang.String name, java.lang.Object value)
Sets the specified parameter.

param
name String to set
param
value Object to set

        NameValue nv = new NameValue(name, value);
        parms.add(nv);
    
public voidsetPhoneNumber(java.lang.String num)
Sets the PhoneNumber field

param
num String to set

        phoneNumber = num;
    
public voidsetPostDial(java.lang.String p)
Sets the PostDial field.

param
p String to set

        NameValue nv = new NameValue(POSTDIAL, p);
        parms.add(nv);