Commit | Line | Data |
---|---|---|
4ab33d2b AO |
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: | |
165c977c | 10 | * Francois Chouinard - Initial API and implementation |
4ab33d2b AO |
11 | *******************************************************************************/ |
12 | ||
165c977c | 13 | package org.eclipse.linuxtools.tmf.stream; |
4ab33d2b AO |
14 | |
15 | import org.eclipse.linuxtools.tmf.event.TmfTimestamp; | |
16 | ||
17 | /** | |
165c977c | 18 | * <b><u>TmfStreamCheckpoint</u></b> |
4ab33d2b AO |
19 | * <p> |
20 | * This class maps an event timestamp with a trace location. | |
21 | */ | |
165c977c | 22 | public class TmfStreamCheckpoint implements Comparable<TmfStreamCheckpoint> { |
4ab33d2b AO |
23 | |
24 | // ======================================================================== | |
25 | // Attributes | |
26 | // ======================================================================== | |
27 | ||
28 | private final TmfTimestamp fTimestamp; | |
29 | private final Object fLocation; | |
30 | ||
31 | // ======================================================================== | |
32 | // Constructors | |
33 | // ======================================================================== | |
34 | ||
35 | /** | |
36 | * @param ts | |
37 | * @param location | |
38 | */ | |
165c977c | 39 | public TmfStreamCheckpoint(TmfTimestamp ts, Object location) { |
4ab33d2b AO |
40 | fTimestamp = ts; |
41 | fLocation = location; | |
42 | } | |
43 | ||
44 | // ======================================================================== | |
45 | // Accessors | |
46 | // ======================================================================== | |
47 | ||
48 | /** | |
165c977c | 49 | * @return the checkpoint event timestamp |
4ab33d2b AO |
50 | */ |
51 | public TmfTimestamp getTimestamp() { | |
52 | return fTimestamp; | |
53 | } | |
54 | ||
55 | /** | |
165c977c | 56 | * @return the checkpoint event stream location |
4ab33d2b AO |
57 | */ |
58 | public Object getLocation() { | |
59 | return fLocation; | |
60 | } | |
61 | ||
62 | // ======================================================================== | |
63 | // Operators | |
64 | // ======================================================================== | |
65 | ||
165c977c | 66 | public int compareTo(TmfStreamCheckpoint other) { |
4ab33d2b AO |
67 | return fTimestamp.compareTo(other.fTimestamp, false); |
68 | } | |
69 | ||
70 | } |