1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 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
.core
.experiment
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimestamp
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.TmfContext
;
19 * <b><u>TmfExperimentCheckpoint</u></b>
21 * TODO: Implement me. Please.
23 public class TmfExperimentCheckpoint
implements Comparable
<TmfExperimentCheckpoint
> {
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 private final TmfTimestamp fTimestamp
;
30 private final TmfContext
[] fContexts
;
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
37 * @param ts the checkpoint timestamp
38 * @param contexts the corresponding set of trace contexts
40 public TmfExperimentCheckpoint(TmfTimestamp ts
, TmfContext
[] contexts
) {
45 // ------------------------------------------------------------------------
47 // ------------------------------------------------------------------------
50 * @return the checkpoint event timestamp
52 public TmfTimestamp
getTimestamp() {
57 * @return the checkpoint event stream location
59 public TmfContext
[] getContexts() {
63 // ------------------------------------------------------------------------
65 // ------------------------------------------------------------------------
68 public int hashCode() {
70 result
= 17 * result
+ fTimestamp
.hashCode();
75 public boolean equals(Object other
) {
76 if (!(other
instanceof TmfExperimentCheckpoint
)) {
79 TmfExperimentCheckpoint o
= (TmfExperimentCheckpoint
) other
;
80 return fTimestamp
.equals(o
.fTimestamp
);
83 // ------------------------------------------------------------------------
85 // ------------------------------------------------------------------------
88 public int compareTo(TmfExperimentCheckpoint other
) {
89 return fTimestamp
.compareTo(other
.fTimestamp
, false);