[Bug304438] Improvement on ITmfLocation
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / trace / TmfCheckpoint.java
CommitLineData
8c8bf09f
ASL
1/*******************************************************************************
2 * Copyright (c) 2009 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13package org.eclipse.linuxtools.tmf.trace;
14
15import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
16
17/**
18 * <b><u>TmfCheckpoint</u></b>
19 * <p>
9f584e4c 20 * This class maps an event timestamp with a location.
8c8bf09f
ASL
21 */
22public class TmfCheckpoint implements Comparable<TmfCheckpoint> {
23
24 // ------------------------------------------------------------------------
25 // Attributes
26 // ------------------------------------------------------------------------
27
9f584e4c 28 private final TmfTimestamp fTimestamp;
452ad365 29 private final ITmfLocation<?> fLocation;
8c8bf09f
ASL
30
31 // ------------------------------------------------------------------------
32 // Constructors
33 // ------------------------------------------------------------------------
34
8c8bf09f 35 /**
9f584e4c
FC
36 * @param ts
37 * @param location
8c8bf09f 38 */
452ad365 39 public TmfCheckpoint(TmfTimestamp ts, ITmfLocation<?> location) {
8c8bf09f
ASL
40 fTimestamp = ts;
41 fLocation = location;
42 }
43
8c8bf09f
ASL
44 // ------------------------------------------------------------------------
45 // Accessors
46 // ------------------------------------------------------------------------
47
48 /**
9f584e4c 49 * @return the checkpoint event timestamp
8c8bf09f
ASL
50 */
51 public TmfTimestamp getTimestamp() {
52 return fTimestamp;
53 }
54
55 /**
9f584e4c 56 * @return the checkpoint event stream location
8c8bf09f 57 */
452ad365 58 public ITmfLocation<?> getLocation() {
8c8bf09f
ASL
59 return fLocation;
60 }
61
8c8bf09f
ASL
62 // ------------------------------------------------------------------------
63 // Comparable
64 // ------------------------------------------------------------------------
65
66 public int compareTo(TmfCheckpoint other) {
67 return fTimestamp.compareTo(other.fTimestamp, false);
68 }
69
70}
This page took 0.027654 seconds and 5 git commands to generate.