Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Conditions Of Use
   *
   * This software was developed by employees of the National Institute of
   * Standards and Technology (NIST), an agency of the Federal Government.
   * Pursuant to title 15 Untied States Code Section 105, works of NIST
   * employees are not subject to copyright protection in the United States
   * and are considered to be in the public domain.  As a result, a formal
   * license is not needed to use the software.
  *
  * This software is provided by NIST as a service and is expressly
  * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
  * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
  * AND DATA ACCURACY.  NIST does not warrant or make any representations
  * regarding the use of the software or the results thereof, including but
  * not limited to the correctness, accuracy, reliability or usefulness of
  * the software.
  *
  * Permission to use this software is contingent upon your acceptance
  * of the terms of this agreement
  *
  * .
  *
  */
 package gov.nist.javax.sdp;
 
 import javax.sdp.*;
 import java.util.*;

Implementation of Time Description

Author(s):
Olivier Deruelle
M. Ranganathan
Version:
1.2
 
 public class TimeDescriptionImpl implements TimeDescription {
 
     private TimeField timeImpl;
 
     private Vector repeatList;

    
Creates new TimeDescriptionImpl
 
     public TimeDescriptionImpl() {
          = new TimeField();
          = new Vector();
 
     }

    
constructor

Parameters:
timeField time field to create this descrition from
 
     public TimeDescriptionImpl(TimeField timeField) {
         this. = timeField;
          = new Vector();
     }

    
Returns the Time field.

Returns:
Time
 
     public Time getTime() {
         return ;
     }

    
Sets the Time field.

Parameters:
timeField Time to set
Throws:
javax.sdp.SdpException if the time is null
 
     public void setTime(Time timeFieldthrows SdpException {
         if (timeField == null) {
             throw new SdpException("The parameter is null");
         } else {
             if (timeField instanceof TimeField) {
                 this. = (TimeFieldtimeField;
             } else
                 throw new SdpException(
                         "The parameter is not an instance of TimeField");
         }
     }

    
Returns the list of repeat times (r= fields) specified in the SessionDescription.

Parameters:
create boolean to set
Returns:
Vector
    public Vector getRepeatTimes(boolean create) {
        return this.;
    }

    
Returns the list of repeat times (r= fields) specified in the SessionDescription.

Parameters:
repeatTimes Vector to set
Throws:
javax.sdp.SdpException if the parameter is null
    public void setRepeatTimes(Vector repeatTimesthrows SdpException {
        this. = repeatTimes;
    }

    
Add a repeat field.

Parameters:
repeatField -- repeat field to add.
    public void addRepeatField(RepeatField repeatField) {
        if (repeatField == null)
            throw new NullPointerException("null repeatField");
        this..add(repeatField);
    }
    public String toString() {
        String retval = .encode();
        for (int i = 0; i < this..size(); i++) {
            RepeatField repeatField = (RepeatFieldthis.
                    .elementAt(i);
            retval += repeatField.encode();
        }
        return retval;
    }
New to GrepCode? Check out our FAQ X