net.sourceforge.jsdp
Class TimeDescription

java.lang.Object
  extended by net.sourceforge.jsdp.TimeDescription
All Implemented Interfaces:
Serializable, Cloneable, Description

public class TimeDescription
extends Object
implements Description

A TimeDescription represents the fields present within a SDP time description.

Since:
0.1.0
Version:
1.1
Author:
Claudio Di Vita
See Also:
Serialized Form

Field Summary
protected  ArrayList repeatTimes
          The repeat time fields
protected  Time t
          The time field
 
Constructor Summary
  TimeDescription()
          Creates a new TimeDescription.
  TimeDescription(Time t)
          Creates a new TimeDescription.
protected TimeDescription(TimeDescription td)
          Creates a new TimeDescription.
 
Method Summary
 void addRepeatTime(RepeatTime field)
          Add a repeat time field.
 void clearRepeatTimes()
          Remove all repeat time fields contained in the time description.
 Object clone()
          Returns a clone of this description.
 RepeatTime[] getRepeatTimes()
          Returns the repeat time fields.
 Time getTime()
          Returns the time field.
 void setRepeatTimes(RepeatTime[] fields)
          Sets the repeat time fields.
 void setTime(Time t)
          Sets the time field.
 String toString()
          Returns a string representation of this description
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

t

protected Time t
The time field


repeatTimes

protected ArrayList repeatTimes
The repeat time fields

Constructor Detail

TimeDescription

public TimeDescription()
Creates a new TimeDescription.


TimeDescription

public TimeDescription(Time t)
                throws IllegalArgumentException
Creates a new TimeDescription.

Parameters:
t - the time field
Throws:
IllegalArgumentException - if the time field is null

TimeDescription

protected TimeDescription(TimeDescription td)
Creates a new TimeDescription. This constructor is used to implement the clone() method, because this class has a default constructor that performs some operations that aren't required while cloning a description.

Parameters:
td - the TimeDescription to clone
Method Detail

addRepeatTime

public void addRepeatTime(RepeatTime field)
                   throws IllegalArgumentException
Add a repeat time field.

Parameters:
field - the field to add
Throws:
IllegalArgumentException - if the field is null

clearRepeatTimes

public void clearRepeatTimes()
Remove all repeat time fields contained in the time description.


clone

public Object clone()
Returns a clone of this description.

Specified by:
clone in interface Description
Overrides:
clone in class Object
Returns:
a clone of this description

getRepeatTimes

public RepeatTime[] getRepeatTimes()
Returns the repeat time fields.

Returns:
an array that contains the repeat time fields contained in the time description

getTime

public Time getTime()
Returns the time field.

Returns:
the time field

setRepeatTimes

public void setRepeatTimes(RepeatTime[] fields)
                    throws IllegalArgumentException
Sets the repeat time fields.

Parameters:
fields - the repeat time fields to set
Throws:
IllegalArgumentException - if one or more repeat time field is null

setTime

public void setTime(Time t)
             throws IllegalArgumentException
Sets the time field.

Parameters:
t - the time field
Throws:
IllegalArgumentException - if the time field is null

toString

public String toString()
Returns a string representation of this description

Specified by:
toString in interface Description
Overrides:
toString in class Object
Returns:
a string representation of the description


Copyright © 2004-2008. All Rights Reserved.