org.lastbamboo.common.sdp.fields
Class RepeatField

java.lang.Object
  extended by org.lastbamboo.common.sdp.GenericObject
      extended by org.lastbamboo.common.sdp.fields.SDPObject
          extended by org.lastbamboo.common.sdp.fields.SDPField
              extended by org.lastbamboo.common.sdp.fields.RepeatField
All Implemented Interfaces:
Serializable, Cloneable, Field, RepeatTime, SDPFieldNames

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
This code is in the public domain.
See Also:
Serialized Form

Field Summary
protected  TypedTime activeDuration
           
protected  SDPObjectList offsets
           
protected  TypedTime repeatInterval
           
 
Fields inherited from class org.lastbamboo.common.sdp.fields.SDPField
fieldName
 
Fields inherited from class org.lastbamboo.common.sdp.GenericObject
AND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, immutableClassNames, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentation
 
Fields inherited from interface org.lastbamboo.common.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 org.lastbamboo.common.sdp.fields.SDPField
getFieldName, getTypeChar, toString
 
Methods inherited from class org.lastbamboo.common.sdp.fields.SDPObject
dbgPrint, debugDump, equals, getStringRepresentation, initSprint, match, merge, replace, replace, replace, replace, sprint
 
Methods inherited from class org.lastbamboo.common.sdp.GenericObject
Assert, dbgPrint, dbgPrint, debugDump, getIndentation, getMatcher, isMySubclass, makeClone, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.lastbamboo.common.sdp.api.Field
getTypeChar
 

Field Detail

repeatInterval

protected TypedTime repeatInterval

activeDuration

protected TypedTime activeDuration

offsets

protected SDPObjectList offsets
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: GenericObject
Get the string encoded version of this object

Specified by:
encode in class SDPField

clone

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

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


Copyright © 2013 LittleShoot. All Rights Reserved.