Remove the generic location (replace by Comparable)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / stubs / org / eclipse / linuxtools / tmf / tests / stubs / trace / TmfTraceStub.java
index 2b192f93c353e8f0a0201314be9973cab966cdc5..fed0590eb3105e8f4fe7d50cbf20aa23c49fb5a9 100644 (file)
@@ -30,7 +30,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTraceIndexer;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
 
 /**
@@ -212,8 +212,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     // ------------------------------------------------------------------------
 
     @Override
-    @SuppressWarnings("unchecked")
-    public TmfContext seekEvent(final ITmfLocation<?> location) {
+    public TmfContext seekEvent(final ITmfLocation location) {
         try {
             fLock.lock();
             try {
@@ -223,7 +222,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
                     long loc  = 0;
                     long rank = 0;
                     if (location != null) {
-                        loc = ((TmfLocation<Long>) location).getLocation();
+                        loc = (Long) location.getLocationData();
                         rank = ITmfContext.UNKNOWN_RANK;
                     }
                     if (loc != fTrace.getFilePointer()) {
@@ -252,7 +251,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
         fLock.lock();
         try {
             if (fTrace != null) {
-                final ITmfLocation<?> location = new TmfLocation<Long>(Long.valueOf((long) (ratio * fTrace.length())));
+                final ITmfLocation location = new TmfLongLocation(Long.valueOf((long) (ratio * fTrace.length())));
                 final TmfContext context = seekEvent(location);
                 context.setRank(ITmfContext.UNKNOWN_RANK);
                 return context;
@@ -267,12 +266,12 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     }
 
     @Override
-    public double getLocationRatio(ITmfLocation<?> location) {
+    public double getLocationRatio(ITmfLocation location) {
         fLock.lock();
         try {
             if (fTrace != null) {
-                if (location.getLocation() instanceof Long) {
-                    return (double) ((Long) location.getLocation()) / fTrace.length();
+                if (location.getLocationData() instanceof Long) {
+                    return (double) ((Long) location.getLocationData()) / fTrace.length();
                 }
             }
         } catch (final IOException e) {
@@ -284,11 +283,11 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     }
 
     @Override
-    public TmfLocation<Long> getCurrentLocation() {
+    public ITmfLocation getCurrentLocation() {
         fLock.lock();
         try {
             if (fTrace != null) {
-                return new TmfLocation<Long>(fTrace.getFilePointer());
+                return new TmfLongLocation(fTrace.getFilePointer());
             }
         } catch (final IOException e) {
             e.printStackTrace();
This page took 0.024809 seconds and 5 git commands to generate.