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

DateHeader

public class DateHeader extends ParameterLessHeader
Date sip header. IMPL_NOTE: implement setHeaderValue()!

Fields Summary
private ExtendedCalendar
date
Value for current date header field.
public static final String
NAME
Label for date header field.
protected static Class
clazz
Class handle.
Constructors Summary
public DateHeader()
Default constructor.


     
        clazz = new DateHeader().getClass();
    
        super(Header.DATE);
        date = new ExtendedCalendar();
    
Methods Summary
public java.lang.Objectclone()
Copies the current instance.

return
copy of the current object

        DateHeader retval = new DateHeader();
        retval.setDate(this.getDate());
        return retval;
    
public java.lang.StringencodeBody()
Encodes into canonical form.

return
encoded string of object contents

        StringBuffer sbuf = new StringBuffer();
        sbuf.append(encodeCalendar(date.getCalendar()));
        return sbuf.toString();
    
public java.util.DategetDate()
Gets the expiry date.

return
get the expiry date.

        return this.date.getTime();
    
public java.lang.ObjectgetValue()
Gets the calendar date.

return
the current date value

        return this.date;
    
public voidsetDate(java.util.Date dateToSet)
Sets the expiry date.

param
dateToSet is the date to set.

        this.date.setTime(dateToSet);
    
public voidsetDate(java.util.Calendar calendarToSet)
Sets the date.

param
calendarToSet the new value for date field

        this.date.setCalendar(calendarToSet);
    
public java.lang.StringtoString()
Encodes the object. Calls encode().

return
String string representation of the date.

        return encode();