import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
// If an event was consumed previously, get the next one from that trace
int lastTrace = expContext.getLastTrace();
if (lastTrace != TmfExperimentContext.NO_TRACE) {
- TmfContext traceContext = expContext.getContexts()[lastTrace];
+ ITmfContext traceContext = expContext.getContexts()[lastTrace];
expContext.getEvents()[lastTrace] = expContext.getTraces()[lastTrace].getNextEvent(traceContext);
expContext.setLastTrace(TmfExperimentContext.NO_TRACE);
}
if (trace != TmfExperimentContext.NO_TRACE) {
// updateIndex(expContext, timestamp);
- TmfContext traceContext = expContext.getContexts()[trace];
+ ITmfContext traceContext = expContext.getContexts()[trace];
TmfExperimentLocation expLocation = (TmfExperimentLocation) expContext.getLocation();
- expLocation.getLocation().locations[trace] = traceContext.getLocation();
+ expLocation.getLocation().locations[trace] = (ITmfLocation<? extends Comparable<?>>) traceContext.getLocation();
updateIndex(expContext, timestamp);
rank += traceRank;
// Set the trace location and read the corresponding event
- expLocation.getLocation().locations[i] = context.getContexts()[i].getLocation().clone();
+ /* The (TmfContext) cast should be safe since we created 'context'
+ * ourselves higher up. */
+ expLocation.getLocation().locations[i] = ((TmfContext) context.getContexts()[i]).getLocation().clone();
context.getEvents()[i] = fTraces[i].getNextEvent(context.getContexts()[i]);
}
// If an event was consumed previously, get the next one from that trace
int lastTrace = expContext.getLastTrace();
if (lastTrace != TmfExperimentContext.NO_TRACE) {
- TmfContext traceContext = expContext.getContexts()[lastTrace];
+ ITmfContext traceContext = expContext.getContexts()[lastTrace];
expContext.getEvents()[lastTrace] = expContext.getTraces()[lastTrace].getNextEvent(traceContext);
expContext.setLastTrace(TmfExperimentContext.NO_TRACE);
}
if (trace != TmfExperimentContext.NO_TRACE) {
updateIndex(expContext, timestamp);
- TmfContext traceContext = expContext.getContexts()[trace];
+ ITmfContext traceContext = expContext.getContexts()[trace];
TmfExperimentLocation expLocation = (TmfExperimentLocation) expContext.getLocation();
// expLocation.getLocation()[trace] = traceContext.getLocation().clone();
- expLocation.getLocation().locations[trace] = traceContext.getLocation().clone();
+ expLocation.getLocation().locations[trace] = (ITmfLocation<? extends Comparable<?>>) traceContext.getLocation().clone();
// updateIndex(expContext, timestamp);
// If an event was consumed previously, get the next one from that trace
int lastTrace = expContext.getLastTrace();
if (lastTrace != TmfExperimentContext.NO_TRACE) {
- TmfContext traceContext = expContext.getContexts()[lastTrace];
+ ITmfContext traceContext = expContext.getContexts()[lastTrace];
expContext.getEvents()[lastTrace] = expContext.getTraces()[lastTrace].getNextEvent(traceContext);
expContext.setLastTrace(TmfExperimentContext.NO_TRACE);
fExperimentContext = (TmfExperimentContext) context;
package org.eclipse.linuxtools.tmf.core.experiment;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
return fTraces;
}
- public TmfContext[] getContexts() {
+ public ITmfContext[] getContexts() {
return fContexts;
}
* @param rank
* @return a context object for subsequent reads
*/
- public TmfContext seekLocation(ITmfLocation<?> location);
+ public ITmfContext seekLocation(ITmfLocation<?> location);
- public TmfContext seekEvent(ITmfTimestamp timestamp);
+ public ITmfContext seekEvent(ITmfTimestamp timestamp);
- public TmfContext seekEvent(long rank);
+ public ITmfContext seekEvent(long rank);
/**
* Positions the trace at the event located at the specified ratio.
* a floating-point number between 0.0 (beginning) and 1.0 (end)
* @return a context object for subsequent reads
*/
- public TmfContext seekLocation(double ratio);
+ public ITmfContext seekLocation(double ratio);
/**
* Returns the ratio corresponding to the specified location.
// ITmfTrace
// ------------------------------------------------------------------------
+ @Override
+ public abstract TmfContext seekLocation(ITmfLocation<?> location);
+
/* (non-Javadoc)
* @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#seekEvent(org.eclipse.linuxtools.tmf.event.TmfTimestamp)
*/
import org.eclipse.linuxtools.tmf.core.signal.TmfTimeSynchSignal;\r
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;\r
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceUpdatedSignal;\r
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;\r
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;\r
import org.eclipse.linuxtools.tmf.ui.editors.ITmfTraceEditor;\r
if (decorationProvider == null) {\r
return; // the trace has been closed\r
}\r
- TmfContext context = null;\r
+ ITmfContext context = null;\r
// TmfTimestamp lastTimestamp = null;\r
boolean done = false;\r
while (!done) {\r
private volatile boolean interrupted = false;\r
private final TimeChartAnalysisEntry fTimeAnalysisEntry;\r
private final TimeChartDecorationProvider fDecorationProvider;\r
- private TmfContext fContext;\r
+ private ITmfContext fContext;\r
private int fCount = 0;\r
\r
private DecorateThread(TimeChartAnalysisEntry timeAnalysisEntry) {\r
import java.util.ArrayList;\r
\r
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;\r
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;\r
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;\r
private static final int SLIDER_MAX = 1000000;\r
\r
private ITmfTrace<?> fTrace;\r
- private TmfContext fBottomContext;\r
+ private ITmfContext fBottomContext;\r
\r
private ScrolledComposite fScrolledComposite;\r
private Composite fTextArea;\r
while (fTopLineIndex < 0) {\r
ITmfLocation<?> endLocation = fLines.get(0).location;\r
firstRatio = Math.max(0, firstRatio - delta);\r
- TmfContext context = fTrace.seekLocation(firstRatio);\r
+ ITmfContext context = fTrace.seekLocation(firstRatio);\r
ITmfLocation<?> location;\r
int index = 0;\r
long rank = 0;\r