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
.trace
;
15 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimestamp
;
18 * <b><u>TmfCheckpoint</u></b>
20 * This class maps an event timestamp to a generic location.
22 public class TmfCheckpoint
implements Comparable
<TmfCheckpoint
> {
24 // ------------------------------------------------------------------------
26 // ------------------------------------------------------------------------
28 private final TmfTimestamp fTimestamp
;
29 private final ITmfLocation
<?
> fLocation
;
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
35 @SuppressWarnings("unused")
36 private TmfCheckpoint() {
42 * @param ts the checkpoint timestamp
43 * @param location the corresponding trace location
45 public TmfCheckpoint(TmfTimestamp ts
, ITmfLocation
<?
> location
) {
51 * Deep copy constructor
52 * @param other the other checkpoint
54 public TmfCheckpoint(TmfCheckpoint other
) {
56 throw new IllegalArgumentException();
57 fTimestamp
= (TmfTimestamp
) other
.fTimestamp
.clone();
58 fLocation
= other
.fLocation
.clone();
61 // ------------------------------------------------------------------------
63 // ------------------------------------------------------------------------
66 * @return the checkpoint timestamp
68 public TmfTimestamp
getTimestamp() {
73 * @return the checkpoint stream location
75 public ITmfLocation
<?
> getLocation() {
79 // ------------------------------------------------------------------------
81 // ------------------------------------------------------------------------
84 public int hashCode() {
85 return fTimestamp
.hashCode();
89 public boolean equals(Object other
) {
90 if (!(other
instanceof TmfCheckpoint
)) {
93 TmfCheckpoint o
= (TmfCheckpoint
) other
;
94 return fTimestamp
.equals(o
.fTimestamp
);
98 public String
toString() {
99 return "[TmfCheckpoint(" + fTimestamp
+ "," + fLocation
+ ")]";
102 // ------------------------------------------------------------------------
104 // ------------------------------------------------------------------------
106 public int compareTo(TmfCheckpoint other
) {
107 return fTimestamp
.compareTo(other
.fTimestamp
, false);
This page took 0.03202 seconds and 5 git commands to generate.