1 /*******************************************************************************
2 * Copyright (c) 2009, 2013 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 * Francois Chouinard - Updated as per TMF Trace Model 1.0
12 * Patrick Tasse - Updated for ranks in experiment location
13 *******************************************************************************/
15 package org
.eclipse
.linuxtools
.internal
.tmf
.core
.trace
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.location
.ITmfLocation
;
21 * The experiment location in TMF.
23 * An experiment location is actually the set of locations of the traces it
24 * contains. By setting the individual traces to their corresponding locations,
25 * the experiment can be positioned to read the next chronological event.
27 * It is the responsibility of the user the individual trace locations are valid
28 * and that they are matched to the correct trace.
31 * @author Francois Chouinard
33 * @see TmfLocationArray
35 public final class TmfExperimentLocation
implements ITmfLocation
{
37 private final TmfLocationArray fLocation
;
39 // ------------------------------------------------------------------------
41 // ------------------------------------------------------------------------
44 * The standard constructor
46 * @param locations the set of trace locations
48 public TmfExperimentLocation(TmfLocationArray locations
) {
49 fLocation
= locations
;
53 * The copy constructor
55 * @param location the other experiment location
57 public TmfExperimentLocation(TmfExperimentLocation location
) {
58 this(location
.getLocationInfo());
61 // ------------------------------------------------------------------------
63 // ------------------------------------------------------------------------
66 @SuppressWarnings("nls")
67 public String
toString() {
68 StringBuilder result
= new StringBuilder("TmfExperimentLocation [");
69 result
.append(fLocation
.toString());
71 return result
.toString();
75 public int hashCode() {
78 result
= prime
* result
+ ((fLocation
!= null) ? fLocation
.hashCode() : 0);
83 public boolean equals(Object obj
) {
90 if (getClass() != obj
.getClass()) {
93 final TmfExperimentLocation other
= (TmfExperimentLocation
) obj
;
94 if (fLocation
== null) {
95 if (other
.fLocation
!= null) {
98 } else if (!fLocation
.equals(other
.fLocation
)) {
105 public TmfLocationArray
getLocationInfo() {