/** Encode the header into a String. * @return String */ public StringBuilder encodeBody(StringBuilder retval) { return date.encode(retval); }
/** * Gets the date of DateHeader. The date is repesented by the Calender * object. * * @return the Calendar object representing the date of DateHeader */ public Calendar getDate() { if (date == null) return null; return date.getJavaCal(); }
/** * The only accessor we allow is to the java calendar record. * All other fields are for this package only. * @return Calendar */ public java.util.Calendar getJavaCal() { if (javaCal == null) setJavaCal(); return javaCal; }
/** * Sets date of DateHeader. The date is repesented by the Calendar object. * * @param dat the Calendar object date of this header. */ public void setDate(Calendar dat) { if (dat != null) date = new SIPDate(dat.getTime().getTime()); }
public Object clone() { SIPDateHeader retval = (SIPDateHeader) super.clone(); if (this.date != null) retval.date = (SIPDate) this.date.clone(); return retval; } }
/** Get the time offset from the current time. * *@return offset from the current time. */ public int getDeltaSeconds() { // long ctime = this.getJavaCal().getTimeInMillis(); long ctime = this.getJavaCal().getTime().getTime(); return (int) (ctime - System.currentTimeMillis()) / 1000; }