FileDocCategorySizeDatePackage
ToHeader.javaAPI DocphoneME MR2 API (J2ME)3603Wed May 02 18:00:42 BST 2007gov.nist.siplite.header

ToHeader

public final class ToHeader extends AddressParametersHeader
ToHeader SIP Header. This code is in the public domain.

Fields Summary
public static final String
NAME
To header field label.
public static final String
TAG
Tag label.
public static Class
clazz
Class handle.
Constructors Summary
public ToHeader()
Default constructor.

    
     
        clazz = new ToHeader().getClass();
    
        super(TO);
    
public ToHeader(FromHeader from)
Generates a TO header from a FROM header.

param
from sender addres

        super(TO);
        address = (Address)from.address.clone();
        parameters = (NameValueList)from.parameters.clone();
    
Methods Summary
public java.lang.StringencodeBody()
Encodes the header content into a String.

return
String

        String retval = "";
        if (address.getAddressType() != Address.NAME_ADDR) {
            retval += Separators.LESS_THAN;
        }
        retval += address.encode();
        if (address.getAddressType() != Address.NAME_ADDR) {
            retval += Separators.GREATER_THAN;
        }
        retval += encodeWithSep();
        return retval;
    
public booleanequals(java.lang.Object otherHeader)
Compares two ToHeader headers for equality.

param
otherHeader Object to set
return
true if the two headers are the same.

        try {
            if (!otherHeader.getClass().equals(this.getClass())) {
                return false;
            }
            return super.equals(otherHeader);
            
        } finally {
            // System.out.println("equals " + retval + exitpoint);
        }
    
public java.lang.StringgetTag()
Gets the tag parameter from the address parm list.

return
tag field

        return getParameter(TAG);
    
public booleanhasTag()
Returns true if tag is present.

return
true if the Tag exist

        return hasParameter(TAG);
    
public voidremoveTag()
Removes the tag field.

        removeParameter(TAG);
    
public voidsetTag(java.lang.String t)
Sets the tag member.

param
t String to set

        setParameter(TAG, t);