(no commit message)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / experiment / TmfExperimentCheckpoint.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 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
13 package org.eclipse.linuxtools.tmf.experiment;
14
15 import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
16 import org.eclipse.linuxtools.tmf.trace.TmfContext;
17
18 /**
19 * <b><u>TmfExperimentCheckpoint</u></b>
20 * <p>
21 * TODO: Implement me. Please.
22 */
23 public class TmfExperimentCheckpoint implements Comparable<TmfExperimentCheckpoint> {
24
25 // ------------------------------------------------------------------------
26 // Attributes
27 // ------------------------------------------------------------------------
28
29 private final TmfTimestamp fTimestamp;
30 private final TmfContext[] fContexts;
31
32 // ------------------------------------------------------------------------
33 // Constructors
34 // ------------------------------------------------------------------------
35
36 /**
37 * @param ts
38 * @param location
39 */
40 public TmfExperimentCheckpoint(TmfTimestamp ts, TmfContext[] contexts) {
41 fTimestamp = ts;
42 fContexts = contexts;
43 }
44
45 // ------------------------------------------------------------------------
46 // Accessors
47 // ------------------------------------------------------------------------
48
49 /**
50 * @return the checkpoint event timestamp
51 */
52 public TmfTimestamp getTimestamp() {
53 return fTimestamp;
54 }
55
56 /**
57 * @return the checkpoint event stream location
58 */
59 public TmfContext[] getContexts() {
60 return fContexts;
61 }
62
63 // ------------------------------------------------------------------------
64 // Object
65 // ------------------------------------------------------------------------
66
67 @Override
68 public int hashCode() {
69 int result = 37;
70 result = 17 * result + fTimestamp.hashCode();
71 return result;
72 }
73
74 @Override
75 public boolean equals(Object other) {
76 if (!(other instanceof TmfExperimentCheckpoint)) {
77 return false;
78 }
79 TmfExperimentCheckpoint o = (TmfExperimentCheckpoint) other;
80 return fTimestamp.equals(o.fTimestamp);
81 }
82
83 // ------------------------------------------------------------------------
84 // Comparable
85 // ------------------------------------------------------------------------
86
87 public int compareTo(TmfExperimentCheckpoint other) {
88 return fTimestamp.compareTo(other.fTimestamp, false);
89 }
90
91 }
This page took 0.031548 seconds and 5 git commands to generate.