Methods Summary |
---|
public java.lang.Object | clone()Copies the current instance.
TimeField retval = new TimeField();
retval.startTime = this.startTime;
retval.stopTime = this.stopTime;
return retval;
|
public java.lang.String | encode()Gets the string encoded version of this object.
return new StringBuffer()
.append(TIME_FIELD)
.append(startTime)
.append(Separators.SP)
.append(stopTime)
.append(Separators.NEWLINE)
.toString();
|
public java.util.Date | getStart()Returns the start time of the conference/session.
return new Date(startTime*1000 + SdpConstants.NTP_CONST);
|
public long | getStartTime()Gets the start time.
return startTime;
|
public java.util.Date | getStop()Returns the stop time of the session.
return new Date(stopTime*1000 + SdpConstants.NTP_CONST);
|
public long | getStopTime()Gets the stop time.
return stopTime;
|
public boolean | getTypedTime()Returns whether the field will be output as a typed time
or a integer value.
Typed time is formatted as an integer followed by a unit character.
The unit indicates an appropriate multiplier for
the integer.
The following unit types are allowed.
d - days (86400 seconds)
h - hours (3600 seconds)
m - minutes (60 seconds)
s - seconds ( 1 seconds)
return false;
|
public boolean | isZero()Returns whether the start and stop times were set to zero (in NTP).
long stopTime = getStopTime();
long startTime = getStartTime();
if (stopTime == 0 && startTime == 0)
return true;
else return false;
|
public void | setStart(java.util.Date start)Sets the start time of the conference/session.
if (start == null)
throw new SdpException("The date is null");
else {
this.startTime = start.getTime()/1000 - SdpConstants.NTP_CONST;
}
|
public void | setStartTime(long startTime)Sets the start time member.
this.startTime = startTime;
|
public void | setStop(java.util.Date stop)Sets the stop time of the session.
if (stop == null)
throw new SdpException("The date is null");
else {
this.stopTime = stop.getTime() / 1000 - SdpConstants.NTP_CONST;
}
|
public void | setStopTime(long stopTime)Sets the stop time member.
this.stopTime = stopTime;
|
public void | setTypedTime(boolean typedTime)Sets whether the field will be output as a typed time or a integer value.
Typed time is formatted as an integer followed by a unit character.
The unit indicates an appropriate multiplier for
the integer.
The following unit types are allowed.
d - days (86400 seconds)
h - hours (3600 seconds)
m - minutes (60 seconds)
s - seconds ( 1 seconds)
|
public void | setZero()Sets the start and stop times to zero (in NTP).
setStopTime(0);
setStartTime(0);
|