[Bug304438] Improvement on ITmfLocation
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / experiment / TmfExperimentLocation.java
index 21b919c099109f0fe359db1f8f4d855c4b336ee6..d24d809cf72f1210aa4244ecdb3aa6255f155c45 100644 (file)
 package org.eclipse.linuxtools.tmf.experiment;
 
 import org.eclipse.linuxtools.tmf.trace.ITmfLocation;
+import org.eclipse.linuxtools.tmf.trace.TmfLocation;
 
 /**
  * <b><u>TmfExperimentLocation</u></b>
  * <p>
  * The experiment location is the set of its traces' locations.
  */
-public class TmfExperimentLocation implements ITmfLocation {
+public class TmfExperimentLocation extends TmfLocation<ITmfLocation<?>[]> {
 
-       private ITmfLocation[] fLocations;
-       
-       public TmfExperimentLocation(ITmfLocation[] locations) {
-               fLocations = locations;
-       }
-
-       public ITmfLocation[] getLocations() {
-               return fLocations;
+       public TmfExperimentLocation(ITmfLocation<?>[] locations) {
+               super(locations);
        }
 
        @Override
        public TmfExperimentLocation clone() {
-               ITmfLocation[] locations = new ITmfLocation[fLocations.length];
-               for (int i = 0; i < fLocations.length; i++) {
-                       locations[i] = fLocations[i].clone();
+               ITmfLocation<?>[] locations = (ITmfLocation<?>[]) getLocation();
+               ITmfLocation<?>[] clones = new ITmfLocation[locations.length];
+               for (int i = 0; i < locations.length; i++) {
+                       clones[i] = locations[i].clone();
                }
-               return new TmfExperimentLocation(locations);
+               return new TmfExperimentLocation(clones);
        }
 
 }
This page took 0.025084 seconds and 5 git commands to generate.