1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.event
;
16 * <b><u>TmfTimeWindow</u></b>
18 * A utility class to define time ranges.
20 public class TmfTimeRange
{
22 // ========================================================================
24 // ========================================================================
26 public static TmfTimeRange Eternity
= new TmfTimeRange(TmfTimestamp
.BigBang
, TmfTimestamp
.BigCrunch
);
28 // ========================================================================
30 // ========================================================================
32 private final TmfTimestamp fStartTime
;
33 private final TmfTimestamp fEndTime
;
35 // ========================================================================
37 // ========================================================================
43 public TmfTimeRange(TmfTimestamp startTime
, TmfTimestamp endTime
) {
44 fStartTime
= startTime
;
48 // ========================================================================
50 // ========================================================================
53 * @return The time range start time
55 public TmfTimestamp
getStartTime() {
60 * @return The time range end time
62 public TmfTimestamp
getEndTime() {
66 // ========================================================================
68 // ========================================================================
71 * Check if the timestamp is within the time range
76 public boolean contains(TmfTimestamp ts
) {
77 boolean result
= (fStartTime
.compareTo(ts
, true) <= 0) && (fEndTime
.compareTo(ts
, true) >= 0);
82 * @see java.lang.Object#toString()
85 public String
toString() {
86 return "[TmfTimeRange (" + fStartTime
.toString() + ":" + fEndTime
.toString() + ")]";
This page took 0.033236 seconds and 5 git commands to generate.