public class

NormalPlayTime

extends Object
java.lang.Object
   ↳ com.google.gdata.data.media.mediarss.NormalPlayTime

Class Overview

Time specification object which tries to conform to section 3.6 of RFC 2326 (Normal Play Time). It does not support ranges. It only supports a millisecond precision. Any time more precise than that will be lost when parsing.

Summary

Fields
public static final NormalPlayTime NOW The NormalPlayType 'now'
private boolean isNow
private long ms
Public Constructors
NormalPlayTime(long ms)
Creates a NormalPlayTime object.
Public Methods
String getNptHhmmssRepresentation()
Gets the standard hh:mm:ss.fraction representation for this object.
String getNptSecondsRepresentation()
Gets the standard seconds.fraction representation for this object.
long getTimeOffsetMs()
Returns the offset it milliseconds, -1l for NOW.
boolean isNow()
Check whether this time is the special 'now' time.
static NormalPlayTime parse(String stringRep)
Parses a NormalPlayTime object and return it.
String toString()
Gets a valid string representation (seconds "." fraction).
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final NormalPlayTime NOW

The NormalPlayType 'now'

private boolean isNow

private long ms

Public Constructors

public NormalPlayTime (long ms)

Creates a NormalPlayTime object. If you want 'NOW', use the constant NOW.

Parameters
ms Time offset, in milliseconds

Public Methods

public String getNptHhmmssRepresentation ()

Gets the standard hh:mm:ss.fraction representation for this object.

Returns
  • hh:mm:ss.fraction or "now"

public String getNptSecondsRepresentation ()

Gets the standard seconds.fraction representation for this object.

Returns
  • seconds.fraction or "now"

public long getTimeOffsetMs ()

Returns the offset it milliseconds, -1l for NOW.

public boolean isNow ()

Check whether this time is the special 'now' time.

public static NormalPlayTime parse (String stringRep)

Parses a NormalPlayTime object and return it.

Parameters
stringRep String representation
Returns
  • a NormalPlayTime, null if and only if stringRep == null
Throws
ParseException if the string representation could not be parsed

public String toString ()

Gets a valid string representation (seconds "." fraction).