import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;\r
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;\r
-import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;\r
+import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;\r
import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;\r
\r
public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {\r
\r
- private static final TmfLocation<Long> NULL_LOCATION = new TmfLocation<Long>((Long) null);\r
+ private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation((Long) null);\r
private static final int DEFAULT_CACHE_SIZE = 100;\r
\r
private final CustomTxtTraceDefinition fDefinition;\r
}\r
\r
@Override\r
- public synchronized TmfContext seekEvent(final ITmfLocation<?> location) {\r
+ public synchronized TmfContext seekEvent(final ITmfLocation location) {\r
final CustomTxtTraceContext context = new CustomTxtTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
if (NULL_LOCATION.equals(location) || fFile == null) {\r
return context;\r
try {\r
if (location == null) {\r
fFile.seek(0);\r
- } else if (location.getLocation() instanceof Long) {\r
- fFile.seek((Long) location.getLocation());\r
+ } else if (location.getLocationData() instanceof Long) {\r
+ fFile.seek((Long) location.getLocationData());\r
}\r
String line;\r
long rawPos = fFile.getFilePointer();\r
for (final InputLine input : getFirstLines()) {\r
final Matcher matcher = input.getPattern().matcher(line);\r
if (matcher.find()) {\r
- context.setLocation(new TmfLocation<Long>(rawPos));\r
+ context.setLocation(new TmfLongLocation(rawPos));\r
context.firstLineMatcher = matcher;\r
context.firstLine = line;\r
context.nextLineLocation = fFile.getFilePointer();\r
}\r
pos--;\r
}\r
- final ITmfLocation<?> location = new TmfLocation<Long>(pos);\r
+ final ITmfLocation location = new TmfLongLocation(pos);\r
final TmfContext context = seekEvent(location);\r
context.setRank(ITmfContext.UNKNOWN_RANK);\r
return context;\r
}\r
\r
@Override\r
- public synchronized double getLocationRatio(final ITmfLocation<?> location) {\r
+ public synchronized double getLocationRatio(final ITmfLocation location) {\r
if (fFile == null) {\r
return 0;\r
}\r
try {\r
- if (location.getLocation() instanceof Long) {\r
- return (double) ((Long) location.getLocation()) / fFile.length();\r
+ if (location.getLocationData() instanceof Long) {\r
+ return (double) ((Long) location.getLocationData()) / fFile.length();\r
}\r
} catch (final IOException e) {\r
Activator.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
}\r
\r
@Override\r
- public ITmfLocation<?> getCurrentLocation() {\r
+ public ITmfLocation getCurrentLocation() {\r
// TODO Auto-generated method stub\r
return null;\r
}\r
}\r
\r
final CustomTxtTraceContext context = (CustomTxtTraceContext) tmfContext;\r
- if (!(context.getLocation().getLocation() instanceof Long) || NULL_LOCATION.equals(context.getLocation())) {\r
+ if (!(context.getLocation().getLocationData() instanceof Long) || NULL_LOCATION.equals(context.getLocation())) {\r
return null;\r
}\r
\r
for (final InputLine input : getFirstLines()) {\r
final Matcher matcher = input.getPattern().matcher(line);\r
if (matcher.find()) {\r
- context.setLocation(new TmfLocation<Long>(rawPos));\r
+ context.setLocation(new TmfLongLocation(rawPos));\r
context.firstLineMatcher = matcher;\r
context.firstLine = line;\r
context.nextLineLocation = fFile.getFilePointer();\r
for (final InputLine input : getFirstLines()) {\r
final Matcher matcher = input.getPattern().matcher(line);\r
if (matcher.find()) {\r
- context.setLocation(new TmfLocation<Long>(rawPos));\r
+ context.setLocation(new TmfLongLocation(rawPos));\r
context.firstLineMatcher = matcher;\r
context.firstLine = line;\r
context.nextLineLocation = fFile.getFilePointer();\r