com.jrockit.mc.flightrecorder.util
Class TimeRangeToolkit

java.lang.Object
  extended by com.jrockit.mc.flightrecorder.util.TimeRangeToolkit

public final class TimeRangeToolkit
extends java.lang.Object

Toolkit for manipulating and formatting ITimeRanges

Author:
Erik gahlin

Method Summary
static long calculateDuration(long startTimestamp, long endTimestamp)
          Calculates the the duration between a start and end time, taking into account that the start and end time stamp can be ITimeRange.NEGATIVE_INFINITY and ITimeRange.POSITIVE_INFINITY
static long cropRange(ITimeRange cropRange, ITimeRange range)
          Crops one time range with another and return the duration.
static java.lang.String formatRange(ITimeRange timeRange)
          Formats a time range as text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cropRange

public static long cropRange(ITimeRange cropRange,
                             ITimeRange range)
Crops one time range with another and return the duration.

Parameters:
cropRange - the range to crop
range - the range it should be cropped to
Returns:
the duration

formatRange

public static java.lang.String formatRange(ITimeRange timeRange)
Formats a time range as text.

Parameters:
timeRange - the time range
Returns:
a textual representation of the time range

calculateDuration

public static long calculateDuration(long startTimestamp,
                                     long endTimestamp)
Calculates the the duration between a start and end time, taking into account that the start and end time stamp can be ITimeRange.NEGATIVE_INFINITY and ITimeRange.POSITIVE_INFINITY

Parameters:
startTimestamp - the start time
endTimestamp - the end time
Returns:
the duration


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