com.adobe.mediacore.utils
Class TimeRange

java.lang.Object
  extended by com.adobe.mediacore.utils.TimeRange

public final class TimeRange
extends Object


Method Summary
static long adjustTime(long time, long begin, long end)
          Adjusts the time to be inside the specified range.
 boolean contains(long time)
           
static TimeRange createRange(long begin, long duration)
          Creates a new time range with the specified values as limits.
 long getBegin()
          Returns the begin time for the time range.
 long getDuration()
          Returns the duration of the time range.
 long getEnd()
          Returns the end time of the time range.
 String toString()
          Returns a String representation of the current time range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createRange

public static TimeRange createRange(long begin,
                                    long duration)
Creates a new time range with the specified values as limits.

Parameters:
begin - The begin time.
duration - The time range duration.
Returns:
TimeRange

getBegin

public long getBegin()
Returns the begin time for the time range.

Returns:
the begin time.

getEnd

public long getEnd()
Returns the end time of the time range.

Returns:
the end time.

getDuration

public long getDuration()
Returns the duration of the time range.

Returns:
the duration.

toString

public String toString()
Returns a String representation of the current time range.

Overrides:
toString in class Object
Returns:
a string containing the beginning and the end of the time range.

contains

public boolean contains(long time)

adjustTime

public static long adjustTime(long time,
                              long begin,
                              long end)
Adjusts the time to be inside the specified range.

Parameters:
time - the time to be adjusted
begin - the begin time
end - the end time
Returns:
the time value if is inside the specified interval, the begin value if the value is lower than the begin of interval and the end value if the value is larger than the end of the interval.