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

gov.nist.javax.sdp.fields
Class RepeatField

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.RepeatField
All Implemented Interfaces:
SDPFieldNames, Serializable, Cloneable, Field, RepeatTime

public class RepeatField
extends SDPField
implements RepeatTime

Repeat SDP Field (part of the time field).

Version:
JSR141-PUBLIC-REVIEW (subject to change).
Author:
Olivier Deruelle , M. Ranganathan
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
RepeatField()
           
 
Method Summary
 void addOffset(TypedTime offset)
           
 Object clone()
          Clones this object.
 String encode()
          Get the string encoded version of this object
 int getActiveDuration()
          Returns the "active duration" in seconds.
 int[] getOffsetArray()
          Returns the list of offsets.
 LinkedList getOffsets()
           
 int getRepeatInterval()
          Returns the "repeat interval" in seconds.
 boolean getTypedTime()
          Returns whether the field will be output as a typed time or a integer value.
 void setActiveDuration(int activeDuration)
          Sets the "active duration" in seconds.
 void setActiveDuration(TypedTime duration)
           
 void setOffsetArray(int[] offsets)
          Set the list of offsets.
 void setRepeatInterval(int repeatInterval)
          Set the "repeat interval" in seconds.
 void setRepeatInterval(TypedTime interval)
           
 void setTypedTime(boolean typedTime)
          Sets whether the field will be output as a typed time or a integer value.
 
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
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
getTypeChar
 

Constructor Detail

RepeatField

public RepeatField()
Method Detail

setRepeatInterval

public void setRepeatInterval(TypedTime interval)

setActiveDuration

public void setActiveDuration(TypedTime duration)

addOffset

public void addOffset(TypedTime offset)

getOffsets

public LinkedList getOffsets()

getRepeatInterval

public int getRepeatInterval()
                      throws SdpParseException
Returns the "repeat interval" in seconds.

Specified by:
getRepeatInterval in interface RepeatTime
Returns:
the "repeat interval" in seconds.
Throws:
SdpParseException

setRepeatInterval

public void setRepeatInterval(int repeatInterval)
                       throws SdpException
Set the "repeat interval" in seconds.

Specified by:
setRepeatInterval in interface RepeatTime
Parameters:
repeatInterval - the "repeat interval" in seconds.
Throws:
SdpException - if repeatInterval is <0

getActiveDuration

public int getActiveDuration()
                      throws SdpParseException
Returns the "active duration" in seconds.

Specified by:
getActiveDuration in interface RepeatTime
Returns:
the "active duration" in seconds.
Throws:
SdpParseException

setActiveDuration

public void setActiveDuration(int activeDuration)
                       throws SdpException
Sets the "active duration" in seconds.

Specified by:
setActiveDuration in interface RepeatTime
Parameters:
activeDuration - the "active duration" in seconds.
Throws:
SdpException - if the active duration is <0

getOffsetArray

public int[] getOffsetArray()
                     throws SdpParseException
Returns the list of offsets. These are relative to the start-time given in the Time object (t= field) with which this RepeatTime is associated.

Specified by:
getOffsetArray in interface RepeatTime
Returns:
the list of offsets
Throws:
SdpParseException

setOffsetArray

public void setOffsetArray(int[] offsets)
                    throws SdpException
Set the list of offsets. These are relative to the start-time given in the Time object (t= field) with which this RepeatTime is associated.

Specified by:
setOffsetArray in interface RepeatTime
Parameters:
offsets - array of repeat time offsets
Throws:
SdpException

getTypedTime

public boolean getTypedTime()
                     throws SdpParseException
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 RepeatTime
Returns:
true, if the field will be output as a typed time; false, if as an integer value.
Throws:
SdpParseException

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 RepeatTime
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.

encode

public String encode()
Description copied from class: gov.nist.core.GenericObject
Get the string encoded version of this object

Specified by:
encode in class SDPField

clone

public Object clone()
Description copied from class: gov.nist.core.GenericObject
Clones this object.

Specified by:
clone in interface Field
Overrides:
clone in class gov.nist.core.GenericObject
Returns:
a clone of this field.

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.