Commit | Line | Data |
---|---|---|
8c8bf09f | 1 | /******************************************************************************* |
61759503 | 2 | * Copyright (c) 2009, 2013 Ericsson |
9b749023 | 3 | * |
8c8bf09f ASL |
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 | |
9b749023 | 8 | * |
8c8bf09f | 9 | * Contributors: |
0316808c FC |
10 | * Francois Chouinard - Initial API and implementation |
11 | * Francois Chouinard - Updated as per TMF Trace Model 1.0 | |
ea271da6 | 12 | * Patrick Tasse - Updated for ranks in experiment location |
8c8bf09f ASL |
13 | *******************************************************************************/ |
14 | ||
9e0640dc | 15 | package org.eclipse.linuxtools.internal.tmf.core.trace; |
8c8bf09f | 16 | |
5cc97265 | 17 | import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation; |
8c8bf09f | 18 | |
d62bb185 | 19 | |
8c8bf09f | 20 | /** |
0316808c FC |
21 | * The experiment location in TMF. |
22 | * <p> | |
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. | |
8c8bf09f | 26 | * <p> |
0316808c FC |
27 | * It is the responsibility of the user the individual trace locations are valid |
28 | * and that they are matched to the correct trace. | |
9b749023 | 29 | * |
0316808c FC |
30 | * @version 1.0 |
31 | * @author Francois Chouinard | |
9b749023 | 32 | * |
0316808c | 33 | * @see TmfLocationArray |
8c8bf09f | 34 | */ |
d62bb185 | 35 | public final class TmfExperimentLocation implements ITmfLocation { |
cb8c854e | 36 | |
d62bb185 | 37 | private final TmfLocationArray fLocation; |
8c8bf09f | 38 | |
0316808c FC |
39 | // ------------------------------------------------------------------------ |
40 | // Constructors | |
41 | // ------------------------------------------------------------------------ | |
8f50c396 | 42 | |
0316808c FC |
43 | /** |
44 | * The standard constructor | |
9b749023 | 45 | * |
0316808c FC |
46 | * @param locations the set of trace locations |
47 | */ | |
48 | public TmfExperimentLocation(TmfLocationArray locations) { | |
cb8c854e | 49 | fLocation = locations; |
0316808c | 50 | } |
8c8bf09f | 51 | |
0316808c FC |
52 | /** |
53 | * The copy constructor | |
9b749023 | 54 | * |
0316808c FC |
55 | * @param location the other experiment location |
56 | */ | |
57 | public TmfExperimentLocation(TmfExperimentLocation location) { | |
5976d44a | 58 | this(location.getLocationInfo()); |
0316808c | 59 | } |
8c8bf09f | 60 | |
0316808c FC |
61 | // ------------------------------------------------------------------------ |
62 | // Object | |
63 | // ------------------------------------------------------------------------ | |
64 | ||
0316808c FC |
65 | @Override |
66 | @SuppressWarnings("nls") | |
67 | public String toString() { | |
ea271da6 PT |
68 | StringBuilder result = new StringBuilder("TmfExperimentLocation ["); |
69 | result.append(fLocation.toString()); | |
0316808c FC |
70 | result.append("]"); |
71 | return result.toString(); | |
72 | } | |
73 | ||
6e85c58d FC |
74 | @Override |
75 | public int hashCode() { | |
0316808c | 76 | return super.hashCode(); |
6e85c58d FC |
77 | } |
78 | ||
79 | @Override | |
80 | public boolean equals(Object obj) { | |
0316808c | 81 | if (this == obj) { |
6e85c58d | 82 | return true; |
0316808c FC |
83 | } |
84 | if (!super.equals(obj)) { | |
6e85c58d | 85 | return false; |
0316808c FC |
86 | } |
87 | if (getClass() != obj.getClass()) { | |
6e85c58d | 88 | return false; |
0316808c | 89 | } |
6e85c58d FC |
90 | return true; |
91 | } | |
92 | ||
cb8c854e | 93 | @Override |
5976d44a | 94 | public TmfLocationArray getLocationInfo() { |
cb8c854e FC |
95 | return fLocation; |
96 | } | |
97 | ||
8c8bf09f | 98 | } |