Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * Conditions Of Use
  *
  * This software was developed by employees of the National Institute of
  * Standards and Technology (NIST), an agency of the Federal Government.
  * Pursuant to title 15 Untied States Code Section 105, works of NIST
  * employees are not subject to copyright protection in the United States
  * and are considered to be in the public domain.  As a result, a formal
  * license is not needed to use the software.
 *
 * This software is provided by NIST as a service and is expressly
 * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
 * AND DATA ACCURACY.  NIST does not warrant or make any representations
 * regarding the use of the software or the results thereof, including but
 * not limited to the correctness, accuracy, reliability or usefulness of
 * the software.
 *
 * Permission to use this software is contingent upon your acceptance
 * of the terms of this agreement
 *
 * .
 *
 */
 package gov.nist.javax.sip.address;
 
 
Implementation of the TelURL interface.

Author(s):
M. Ranganathan
Version:
1.2 $Revision: 1.11 $ $Date: 2010-05-06 14:08:06 $
 
 public class TelURLImpl
     extends GenericURI
     implements javax.sip.address.TelURL {
 
 
     private static final long serialVersionUID = 5873527320305915954L;
 
     protected TelephoneNumber telephoneNumber;

    
Creates a new instance of TelURLImpl
 
     public TelURLImpl() {
         this. = "tel";
     }

    
Set the telephone number.

Parameters:
telephoneNumber -- telephone number to set.
 
 
     public void setTelephoneNumber(TelephoneNumber telephoneNumber) {
         this. = telephoneNumber;
     }

    
Returns the value of the isdnSubAddress parameter, or null if it is not set.

Returns:
the value of the isdnSubAddress parameter
 
     public String getIsdnSubAddress() {
         return .getIsdnSubaddress();
     }

    
Returns the value of the postDial parameter, or null if it is not set.

Returns:
the value of the postDial parameter
 
     public String getPostDial() {
         return .getPostDial();
     }

    
Returns the value of the "scheme" of this URI, for example "sip", "sips" or "tel".

Returns:
the scheme paramter of the URI
 
     public String getScheme() {
         return this.;
     }

    
Returns true if this TelURL is global i.e. if the TelURI has a global phone user.

Returns:
true if this TelURL represents a global phone user, and false otherwise.
 
     public boolean isGlobal() {
         return .isGlobal();
     }

    
This method determines if this is a URI with a scheme of "sip" or "sips".

Returns:
true if the scheme is "sip" or "sips", false otherwise.
    public boolean isSipURI() {
        return false;
    }

    
Sets phone user of this TelURL to be either global or local. The default value is false, hence the TelURL is defaulted to local.

Parameters:
global - the boolean value indicating if the TelURL has a global phone user.
    public void setGlobal(boolean global) {
        this..setGlobal(global);
    }

    
Sets ISDN subaddress of this TelURL. If a subaddress is present, it is appended to the phone number after ";isub=".

Parameters:
isdnSubAddress - new value of the isdnSubAddress parameter
    public void setIsdnSubAddress(String isdnSubAddress) {
        this..setIsdnSubaddress(isdnSubAddress);
    }

    
Sets post dial of this TelURL. The post-dial sequence describes what and when the local entity should send to the phone line.

Parameters:
postDial - new value of the postDial parameter
    public void setPostDial(String postDial) {
        this..setPostDial(postDial);
    }

    
Set the telephone number.

Parameters:
telephoneNumber long phone number to set.
    public void setPhoneNumber(String telephoneNumber) {
        this..setPhoneNumber(telephoneNumber);
    }

    
Get the telephone number.

Returns:
-- the telephone number.
    public String getPhoneNumber() {
        return this..getPhoneNumber();
    }

    
Return the string encoding.

Returns:
-- the string encoding.
    public String toString() {
        return this. + ":" + .encode();
    }
    public String encode() {
        return encode(new StringBuilder()).toString();
    }
    public StringBuilder encode(StringBuilder buffer) {
        buffer.append(this.).append(':');
        .encode(buffer);
        return buffer;
    }

    
Deep copy clone operation.

Returns:
-- a cloned version of this telephone number.
    public Object clone() {
        TelURLImpl retval = (TelURLImplsuper.clone();
        if (this. != null)
            retval.telephoneNumber = (TelephoneNumberthis..clone();
        return retval;
    }
    public String getParameter(String parameterName) {
        return .getParameter(parameterName);
    }
    public void setParameter(String nameString value) {
        .setParameter(namevalue);
    }
    public Iterator<StringgetParameterNames() {
        return .getParameterNames();
    }
    public NameValueList getParameters() {
        return .getParameters();
    }
    public void removeParameter(String name) {
        .removeParameter(name);
    }
    /* (non-Javadoc)
     * @see javax.sip.address.TelURL#setPhoneContext(java.lang.String)
     */
    public void setPhoneContext(String phoneContextthrows ParseException {
        // JvB: set (null) should be interpreted as 'remove'
        if (phoneContext==null) {
            this.removeParameter("phone-context");
        } else {
            this.setParameter("phone-context",phoneContext);
        }
    }
    /* (non-Javadoc)
     * @see javax.sip.address.TelURL#getPhoneContext()
     */
    public String getPhoneContext() {
        return this.getParameter("phone-context");
    }
New to GrepCode? Check out our FAQ X