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;
/**
// ------------------------------------------------------------------------
@Override
- @SuppressWarnings("unchecked")
- public TmfContext seekEvent(final ITmfLocation<?> location) {
+ public TmfContext seekEvent(final ITmfLocation location) {
try {
fLock.lock();
try {
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()) {
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;
}
@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) {
}
@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();