FileDocCategorySizeDatePackage
TimeDescriptionImpl.javaAPI DocphoneME MR2 API (J2ME)3691Wed May 02 18:00:42 BST 2007gov.nist.javax.sdp

TimeDescriptionImpl

public class TimeDescriptionImpl extends Object
Implementation of Time Description
version
JAIN-SIP-1.1 This code is in the public domain.

Fields Summary
private TimeField
timeImpl
Time field.
private Vector
repeatList
Vector of repeat times.
Constructors Summary
public TimeDescriptionImpl()
Creates new TimeDescriptionImpl

	timeImpl = new TimeField();
	repeatList = new Vector();
 
    
public TimeDescriptionImpl(TimeField timeField)
Constructs a time description with an initial time field.

param
timeField to set

	this.timeImpl = timeField;
	repeatList = new Vector();
    
Methods Summary
public voidaddRepeatField(RepeatField repeatField)
Adds a repeat field.

param
repeatField repeat field to add.

	if (repeatField == null) 
	    throw new NullPointerException("null repeatField");
	this.repeatList.addElement(repeatField);
    
public java.util.VectorgetRepeatTimes(boolean create)
Returns the list of repeat times (r= fields) specified in the SessionDescription.

param
create boolean to set
return
Vector

	return this.repeatList;
    
public TimeFieldgetTime()
Returns the Time field.

return
Time

	return timeImpl;
    
public voidsetRepeatTimes(java.util.Vector repeatTimes)
Returns the list of repeat times (r= fields) specified in the SessionDescription.

param
repeatTimes Vector to set
throws
SdpException if the parameter is null

	this.repeatList = repeatTimes;
    
public voidsetTime(TimeField timeField)
Sets the Time field.

param
timeField Time to set
throws
SdpException if the time is null

	if (timeField == null) {
	    throw new SdpException("The parameter is null");
	} else {
	    if (timeField instanceof TimeField) {
		this.timeImpl = (TimeField)timeField;
	    } else
		throw new SdpException
		    ("The parameter is not an instance of TimeField");
	}
    
public java.lang.StringtoString()
Encodes contents as a string.

return
encoded string of object contents

	String retval = timeImpl.encode();
	for (int i = 0; i < this.repeatList.size(); i++) {
	    RepeatField repeatField = 
		(RepeatField) this.repeatList.elementAt(i);
	    retval += repeatField.encode();
	}
	return retval;