1 /*******************************************************************************
2 * Copyright (c) 2009, 2010, 2012 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 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.internal
.tmf
.core
.trace
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfLocation
;
19 * The experiment location in TMF.
21 * An experiment location is actually the set of locations of the traces it
22 * contains. By setting the individual traces to their corresponding locations,
23 * the experiment can be positioned to read the next chronological event.
25 * It is the responsibility of the user the individual trace locations are valid
26 * and that they are matched to the correct trace.
29 * @author Francois Chouinard
31 * @see TmfLocationArray
33 public class TmfExperimentLocation
implements ITmfLocation
{
35 TmfLocationArray fLocation
;
37 // ------------------------------------------------------------------------
39 // ------------------------------------------------------------------------
42 * The standard constructor
44 * @param locations the set of trace locations
46 public TmfExperimentLocation(TmfLocationArray locations
) {
47 fLocation
= locations
;
51 * The copy constructor
53 * @param location the other experiment location
55 public TmfExperimentLocation(TmfExperimentLocation location
) {
56 this(location
.getLocationInfo());
59 // ------------------------------------------------------------------------
61 // ------------------------------------------------------------------------
64 * @see org.eclipse.linuxtools.tmf.core.trace.TmfLocation#clone()
67 public TmfExperimentLocation
clone() {
68 // super.clone(); // To keep FindBugs happy
69 TmfLocationArray array
= getLocationInfo();
70 TmfLocationArray clones
= array
.clone();
71 return new TmfExperimentLocation(clones
);
74 // ------------------------------------------------------------------------
76 // ------------------------------------------------------------------------
79 * @see org.eclipse.linuxtools.tmf.core.trace.TmfLocation#toString()
82 @SuppressWarnings("nls")
83 public String
toString() {
84 StringBuilder result
= new StringBuilder("[TmfExperimentLocation");
85 ITmfLocation
[] locations
= getLocationInfo().getLocations();
86 for (ITmfLocation location
: locations
) {
87 result
.append("[" + location
+ "]");
90 return result
.toString();
94 * @see org.eclipse.linuxtools.tmf.core.trace.TmfLocation#hashCode()
97 public int hashCode() {
98 return super.hashCode();
102 * @see org.eclipse.linuxtools.tmf.core.trace.TmfLocation#equals(java.lang.Object)
105 public boolean equals(Object obj
) {
109 if (!super.equals(obj
)) {
112 if (getClass() != obj
.getClass()) {
119 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfLocation#getLocationData()
122 public TmfLocationArray
getLocationInfo() {