Class MediaDurationImpl
java.lang.Object
org.opencastproject.metadata.mpeg7.MediaDurationImpl
- All Implemented Interfaces:
XmlElement,MediaDuration
TODO: Comment me!
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a media duration representingPD0T00H00M00S00N0F.MediaDurationImpl(long milliseconds) Creates a media duration representing the given long value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetDays()Returns the number of days.longReturns the duration in milliseconds.intReturns the fractions.intReturns the fractions per second.intgetHours()Returns the number of hours.intReturns the number of minutes.intReturns the number of seconds.inthashCode()voidParses a duration text representation.static MediaDurationparseDuration(String text) Parses a duration text representation.voidsetDayDuration(int days) Sets the number of days.voidsetFractionDuration(int fractions) Sets the number of fractions.voidsetFractionsPerSecond(int fractionsPerSecond) Sets the number of fractions per second.voidsetHourDuration(short hours) Sets the number of hours.voidsetMinuteDuration(short minutes) Sets the number of minutes.voidsetSecondDuration(short seconds) Sets the number of seconds.toString()Returns an xml node representation of this element.
-
Constructor Details
-
MediaDurationImpl
public MediaDurationImpl()Creates a media duration representingPD0T00H00M00S00N0F. -
MediaDurationImpl
public MediaDurationImpl(long milliseconds) Creates a media duration representing the given long value.
-
-
Method Details
-
parseDuration
Parses a duration text representation.- Parameters:
text- the duration text representation- Returns:
- the media duration object
- Throws:
IllegalArgumentException- if the text is not in the right format
-
parse
Parses a duration text representation.- Parameters:
text- the duration text representation- Throws:
IllegalArgumentException- if the text is not in the right format
-
getDays
public int getDays()Description copied from interface:MediaDurationReturns the number of days.- Specified by:
getDaysin interfaceMediaDuration- Returns:
- the days
- See Also:
-
getFractions
public int getFractions()Description copied from interface:MediaDurationReturns the fractions.- Specified by:
getFractionsin interfaceMediaDuration- Returns:
- the fractions
- See Also:
-
getFractionsPerSecond
public int getFractionsPerSecond()Description copied from interface:MediaDurationReturns the fractions per second.- Specified by:
getFractionsPerSecondin interfaceMediaDuration- Returns:
- the fractions per second
- See Also:
-
getHours
public int getHours()Description copied from interface:MediaDurationReturns the number of hours.- Specified by:
getHoursin interfaceMediaDuration- Returns:
- the hours
- See Also:
-
getMinutes
public int getMinutes()Description copied from interface:MediaDurationReturns the number of minutes.- Specified by:
getMinutesin interfaceMediaDuration- Returns:
- the minutes
- See Also:
-
getSeconds
public int getSeconds()Description copied from interface:MediaDurationReturns the number of seconds.- Specified by:
getSecondsin interfaceMediaDuration- Returns:
- the seconds
- See Also:
-
setDayDuration
public void setDayDuration(int days) Sets the number of days.- Parameters:
days-
-
setFractionDuration
public void setFractionDuration(int fractions) Sets the number of fractions.- Parameters:
fractions- the fractions
-
setFractionsPerSecond
public void setFractionsPerSecond(int fractionsPerSecond) Sets the number of fractions per second.- Parameters:
fractionsPerSecond- the fractions per second
-
setHourDuration
public void setHourDuration(short hours) Sets the number of hours.- Parameters:
hours- the hours
-
setMinuteDuration
public void setMinuteDuration(short minutes) Sets the number of minutes.- Parameters:
minutes- the number of minutes
-
setSecondDuration
public void setSecondDuration(short seconds) Sets the number of seconds.- Parameters:
seconds- the number of seconds
-
toString
-
getDurationInMilliseconds
public long getDurationInMilliseconds()Description copied from interface:MediaDurationReturns the duration in milliseconds.- Specified by:
getDurationInMillisecondsin interfaceMediaDuration- Returns:
- the number of milliseconds
- See Also:
-
hashCode
public int hashCode() -
equals
-
toXml
Description copied from interface:XmlElementReturns an xml node representation of this element.- Specified by:
toXmlin interfaceXmlElement- Parameters:
document- the enclosing xml document- Returns:
- the xml node
- See Also:
-