com.sun.syndication.feed.module.itunes.types
Class Duration

java.lang.Object
  extended by com.sun.syndication.feed.module.itunes.types.Duration
All Implemented Interfaces:
java.io.Serializable

public class Duration
extends java.lang.Object
implements java.io.Serializable

An encapsulation of the duration of a podcast. This will serialize (via .toString()) to HH:MM:SS format, and can parse [H]*H:[M]*M:[S]*S or [M]*M:[S]*S.

Version:
$Revision: 1.7 $
Author:
Robert "kebernet" Cooper
See Also:
Serialized Form

Constructor Summary
Duration()
          Creates a new Duration object with 0 length.
Duration(int hours, int minutes, float seconds)
          Creates a new duration object with the given hours, minutes and seconds
Duration(long milliseconds)
          Creates a new instance of Duration specifying a length in milliseconds
Duration(java.lang.String duration)
          Creates a new Duration parsing the String value.
 
Method Summary
 long getMilliseconds()
          Returns the millisecond length
 void setMilliseconds(long milliseconds)
          Sets the millisecond length
 java.lang.String toString()
          Returns a String representation in the formation HH:MM:SS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Duration

public Duration()
Creates a new Duration object with 0 length.


Duration

public Duration(long milliseconds)
Creates a new instance of Duration specifying a length in milliseconds

Parameters:
milliseconds - Creates a new instance of Duration specifying a length in milliseconds

Duration

public Duration(int hours,
                int minutes,
                float seconds)
Creates a new duration object with the given hours, minutes and seconds

Parameters:
hours - number of hours
minutes - number of minutes
seconds - number of seconds

Duration

public Duration(java.lang.String duration)
Creates a new Duration parsing the String value.

Parameters:
duration - A String to parse
Method Detail

toString

public java.lang.String toString()
Returns a String representation in the formation HH:MM:SS

Overrides:
toString in class java.lang.Object
Returns:
Returns a String representation in the formation HH:MM:SS

getMilliseconds

public long getMilliseconds()
Returns the millisecond length

Returns:
the millisecond length

setMilliseconds

public void setMilliseconds(long milliseconds)
Sets the millisecond length

Parameters:
milliseconds - the millisecond length


Copyright © 2006-2009. All Rights Reserved.