com.jrockit.mc.flightrecorder.util
Class TimeRange

java.lang.Object
  extended by com.jrockit.mc.flightrecorder.util.TimeRange
All Implemented Interfaces:
ITimeRange

public final class TimeRange
extends java.lang.Object
implements ITimeRange

Class that represents a range. The range holds a start and an end time. The timestamps are in nanoseconds since 1970.

Author:
Erik Gahlin

Field Summary
 
Fields inherited from interface com.jrockit.mc.flightrecorder.spi.ITimeRange
INFINITE_DURATION, INFINITE_RANGE, NEGATIVE_INFINITY, POSITIVE_INFINITY
 
Constructor Summary
TimeRange(long start, long end)
          Constructs a time range The end time must not come before the start time
 
Method Summary
 long getDuration()
          Returns the duration of the range.
 long getEndTimestamp()
          Returns the end time of the range.
 long getStartTimestamp()
          Returns the start time of the range.
 java.lang.String toString()
          Returns a textual representation of the range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeRange

public TimeRange(long start,
                 long end)
Constructs a time range The end time must not come before the start time

Parameters:
start - the start time, in nanoseconds since 1970.
end - the end time, in nanoseconds since 1970.
Method Detail

toString

public java.lang.String toString()
Returns a textual representation of the range

Overrides:
toString in class java.lang.Object

getDuration

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

Specified by:
getDuration in interface ITimeRange
Returns:
the duration, in nanoseconds.

getEndTimestamp

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

Specified by:
getEndTimestamp in interface ITimeRange
Returns:
the duration, in nanoseconds.

getStartTimestamp

public long getStartTimestamp()
Returns the start time of the range.

Specified by:
getStartTimestamp in interface ITimeRange
Returns:
the duration, in nanoseconds.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.