NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sdp.fields
Class TimeField

java.lang.Object
  extended by gov.nist.core.GenericObject
      extended by gov.nist.javax.sdp.fields.SDPObject
          extended by gov.nist.javax.sdp.fields.SDPField
              extended by gov.nist.javax.sdp.fields.TimeField
All Implemented Interfaces:
SDPFieldNames, Serializable, Cloneable, Field, Time

public class TimeField
extends SDPField
implements Time

Time Field.

Version:
JSR141-PUBLIC-REVIEW (subject to change).
Author:
Olivier Deruelle , M. Ranganathan Bug Report contributed by Brian J. Collins.
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gov.nist.javax.sdp.fields.SDPFieldNames
ATTRIBUTE_FIELD, BANDWIDTH_FIELD, CONNECTION_FIELD, EMAIL_FIELD, INFORMATION_FIELD, KEY_FIELD, MEDIA_FIELD, ORIGIN_FIELD, PHONE_FIELD, PROTO_VERSION_FIELD, REPEAT_FIELD, SESSION_NAME_FIELD, TIME_FIELD, URI_FIELD, ZONE_FIELD
 
Constructor Summary
TimeField()
           
 
Method Summary
 String encode()
          Get the string encoded version of this object
 Date getStart()
          Returns the start time of the conference/session.
 long getStartTime()
           
 Date getStop()
          Returns the stop time of the session
 long getStopTime()
           
 boolean getTypedTime()
          Returns whether the field will be output as a typed time or a integer value.
 boolean isZero()
          Returns whether the start and stop times were set to zero (in NTP).
 void setStart(Date start)
          Sets the start time of the conference/session.
 void setStartTime(long startTime)
          Set the startTime member
 void setStop(Date stop)
          Sets the stop time of the session.
 void setStopTime(long stopTime)
          Set the stopTime member
 void setTypedTime(boolean typedTime)
          Sets whether the field will be output as a typed time or a integer value.
 void setZero()
          Sets the start and stop times to zero (in NTP).
 
Methods inherited from class gov.nist.javax.sdp.fields.SDPField
getFieldName, getTypeChar, toString
 
Methods inherited from class gov.nist.javax.sdp.fields.SDPObject
dbgPrint, debugDump, equals, match
 
Methods inherited from class gov.nist.core.GenericObject
clone, debugDump, encode, getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sdp.Field
clone, getTypeChar
 

Constructor Detail

TimeField

public TimeField()
Method Detail

getStartTime

public long getStartTime()

getStopTime

public long getStopTime()

setStartTime

public void setStartTime(long startTime)
Set the startTime member


setStopTime

public void setStopTime(long stopTime)
Set the stopTime member


getStart

public Date getStart()
              throws SdpParseException
Returns the start time of the conference/session.

Specified by:
getStart in interface Time
Returns:
the date
Throws:
SdpParseException

getStop

public Date getStop()
             throws SdpParseException
Returns the stop time of the session

Specified by:
getStop in interface Time
Returns:
the stop time of the session.
Throws:
SdpParseException

setStop

public void setStop(Date stop)
             throws SdpException
Sets the stop time of the session.

Specified by:
setStop in interface Time
Parameters:
stop - start - the start time
Throws:
SdpException - if the date is null

setStart

public void setStart(Date start)
              throws SdpException
Sets the start time of the conference/session.

Specified by:
setStart in interface Time
Parameters:
start - start - the start time for the session.
Throws:
SdpException - if the date is null

getTypedTime

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)

Specified by:
getTypedTime in interface Time
Returns:
true, if the field will be output as a typed time; false, if as an integer value.

setTypedTime

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)

Specified by:
setTypedTime in interface Time
Parameters:
typedTime - typedTime - if set true, the start and stop times will be output in an optimal typed time format; if false, the times will be output as integers.

isZero

public boolean isZero()
Returns whether the start and stop times were set to zero (in NTP).

Specified by:
isZero in interface Time
Returns:
boolean

setZero

public void setZero()
Sets the start and stop times to zero (in NTP).

Specified by:
setZero in interface Time

encode

public String encode()
Get the string encoded version of this object

Specified by:
encode in class SDPField
Since:
v1.0

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.