CtfIteratorTest.class,
CtfLocationDataTest.class,
CtfLocationTest.class,
- CtfTmfLightweightContextTest.class,
+ CtfTmfContextTest.class,
CtfTmfEventFieldTest.class,
CtfTmfEventTest.class,
CtfTmfEventTypeTest.class,
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Matthew Khouzam - Initial implementation
+ * Alexandre Montplaisir
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
+
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
+import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfContext;
+import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
+import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests for the CtfTmfLightweightContext class
+ *
+ * @author Matthew Khouzam
+ * @version 1.1
+ */
+public class CtfTmfContextTest {
+
+ private static final String PATH = TestParams.getPath();
+ private static final long begin = 1332170682440133097L; /* Trace start time */
+ private static final long end = 1332170692664579801L; /* Trace end time */
+
+ private CtfTmfTrace trace;
+
+ private class SeekerThread extends Thread {
+ long val;
+
+ public void setVal(long val) {
+ this.val = val;
+ }
+ }
+
+ /**
+ * Pre-test initialization
+ *
+ * @throws TmfTraceException
+ * If the trace couldn't be init'ed, which shouldn't happen.
+ */
+ @Before
+ public void setUp() throws TmfTraceException {
+ trace = new CtfTmfTrace();
+ trace.initTrace((IResource) null, PATH, CtfTmfEvent.class);
+ }
+
+ /**
+ * Index all the events in the test trace.
+ */
+ @Test
+ public void testIndexing() {
+ CtfTmfContext context = new CtfTmfContext(trace);
+ context.seek(0);
+
+ int count = 0;
+ while (trace.getNext(context) != null) {
+ count++;
+ }
+ assertTrue(count > 0);
+ }
+
+ /**
+ * Context fuzzer. Use an amount of contexts greater than the size of the
+ * iterator cache and have them access the trace in parallel.
+ *
+ * @throws InterruptedException
+ * Would fail the test
+ */
+ @Test
+ public void testTooManyContexts() throws InterruptedException {
+ final int lwcCount = 101;
+ double increment = (end - begin) / lwcCount;
+ final ArrayList<Long> vals = new ArrayList<Long>();
+ final ArrayList<Thread> threads = new ArrayList<Thread>();
+ final ArrayList<CtfTmfContext> tooManyContexts = new ArrayList<CtfTmfContext>();
+
+ for (double i = begin; i < end; i += increment) {
+ SeekerThread thread = new SeekerThread() {
+ @Override
+ public void run() {
+ CtfTmfContext lwc = new CtfTmfContext(trace);
+ lwc.seek(val);
+ trace.getNext(lwc);
+ synchronized(trace){
+ if (lwc.getCurrentEvent() != null) {
+ vals.add(lwc.getCurrentEvent().getTimestamp().getValue());
+ }
+ tooManyContexts.add(lwc);
+ }
+ }
+ };
+ thread.setVal((long)i);
+ threads.add(thread);
+ thread.start();
+ }
+
+ for( Thread t: threads){
+ t.join();
+ }
+
+ for( Long val : vals){
+ assertTrue(val >= begin);
+ assertTrue(val <= end);
+ }
+ }
+
+ /**
+ * Test for clone method
+ */
+ @Test
+ public void testClone() {
+ CtfTmfContext fixture1 = new CtfTmfContext(trace);
+ CtfTmfContext fixture2 = fixture1.clone();
+ //assertTrue(fixture1.equals(fixture2)); FIXME no .equals() override!
+ assertNotSame(fixture1, fixture2);
+
+ /* Make sure clone() did its job */
+ assertSame(fixture1.getTrace(), fixture2.getTrace());
+ assertSame(fixture1.getLocation(), fixture2.getLocation());
+ assertSame(fixture1.getRank(), fixture2.getRank());
+ }
+}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Matthew Khouzam - Initial implementation
- * Alexandre Montplaisir
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfLightweightContext;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
-import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests for the CtfTmfLightweightContext class
- *
- * @author Matthew Khouzam
- * @version 1.1
- */
-public class CtfTmfLightweightContextTest {
-
- private static final String PATH = TestParams.getPath();
- private static final long begin = 1332170682440133097L; /* Trace start time */
- private static final long end = 1332170692664579801L; /* Trace end time */
-
- private CtfTmfTrace fixture;
-
- private class SeekerThread extends Thread {
- long val;
-
- public void setVal(long val) {
- this.val = val;
- }
- }
-
- /**
- * Pre-test initialization
- *
- * @throws TmfTraceException
- * If the trace couldn't be init'ed, which shouldn't happen.
- */
- @Before
- public void setUp() throws TmfTraceException {
- fixture = new CtfTmfTrace();
- fixture.initTrace((IResource) null, PATH, CtfTmfEvent.class);
- }
-
- /**
- * Index all the events in the test trace.
- */
- @Test
- public void testIndexing() {
- CtfTmfLightweightContext context = new CtfTmfLightweightContext(fixture);
- context.seek(0);
-
- int count = 0;
- while (fixture.getNext(context) != null) {
- count++;
- }
- assertTrue(count > 0);
- }
-
- /**
- * Context fuzzer. Use an amount of contexts greater than the size of the
- * iterator cache and have them access the trace in parallel.
- *
- * @throws InterruptedException
- * Would fail the test
- */
- @Test
- public void testTooManyContexts() throws InterruptedException {
- final int lwcCount = 101;
- double increment = (end - begin) / lwcCount;
- final ArrayList<Long> vals = new ArrayList<Long>();
- final ArrayList<Thread> threads = new ArrayList<Thread>();
- final ArrayList<CtfTmfLightweightContext> tooManyContexts = new ArrayList<CtfTmfLightweightContext>();
-
- for (double i = begin; i < end; i += increment) {
- SeekerThread thread = new SeekerThread() {
- @Override
- public void run() {
- CtfTmfLightweightContext lwc = new CtfTmfLightweightContext(fixture);
- lwc.seek(val);
- fixture.getNext(lwc);
- synchronized(fixture){
- if (lwc.getCurrentEvent() != null) {
- vals.add(lwc.getCurrentEvent().getTimestamp().getValue());
- }
- tooManyContexts.add(lwc);
- }
- }
- };
- thread.setVal((long)i);
- threads.add(thread);
- thread.start();
- }
-
- for( Thread t: threads){
- t.join();
- }
-
- for( Long val : vals){
- assertTrue(val >= begin);
- assertTrue(val <= end);
- }
- }
-}
import java.util.Vector;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfLightweightContext;
+import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfContext;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
start = System.nanoTime();
if (nbEvent != -1) {
- final CtfTmfLightweightContext traceReader = (CtfTmfLightweightContext) trace.seekEvent(0);
+ final CtfTmfContext traceReader = (CtfTmfContext) trace.seekEvent(0);
start = System.nanoTime();
CtfTmfEvent current = traceReader.getCurrentEvent();
* @author Matthew Khouzam
*/
public class CtfIterator extends CTFTraceReader implements ITmfContext,
- Comparable<CtfIterator>, Cloneable {
+ Comparable<CtfIterator> {
private final CtfTmfTrace ctfTmfTrace;
* @param ctx
* the context
* @return the iterator
+ * @since 2.0
*/
public static synchronized CtfIterator getIterator(final CtfTmfTrace trace,
- final CtfTmfLightweightContext ctx) {
+ final CtfTmfContext ctx) {
return map.get(trace).getIterator(ctx);
}
}
/*
* The map of the cache.
*/
- private final HashMap<CtfTmfLightweightContext, CtfIterator> fMap;
+ private final HashMap<CtfTmfContext, CtfIterator> fMap;
/*
* An array pointing to the same cache. this allows fast "random" accesses.
*/
- private final ArrayList<CtfTmfLightweightContext> fRandomAccess;
+ private final ArrayList<CtfTmfContext> fRandomAccess;
/*
* The parent trace
*/
private final Random fRnd;
public CtfTraceManager(CtfTmfTrace trace) {
- fMap = new HashMap<CtfTmfLightweightContext, CtfIterator>();
- fRandomAccess = new ArrayList<CtfTmfLightweightContext>();
+ fMap = new HashMap<CtfTmfContext, CtfIterator>();
+ fRandomAccess = new ArrayList<CtfTmfContext>();
fRnd = new Random(System.nanoTime());
fTrace = trace;
}
* the context to look up
* @return the iterator refering to the context
*/
- public CtfIterator getIterator(final CtfTmfLightweightContext context) {
+ public CtfIterator getIterator(final CtfTmfContext context) {
/*
* if the element is in the map, we don't need to do anything else.
*/
* @param elem
* the iterator
*/
- private void addElement(final CtfTmfLightweightContext context,
+ private void addElement(final CtfTmfContext context,
final CtfIterator elem) {
fMap.put(context, elem);
fRandomAccess.add(context);
* @return the iterator of the removed elements.
*/
private CtfIterator replaceRandomElement(
- final CtfTmfLightweightContext context) {
+ final CtfTmfContext context) {
/*
* This needs some explanation too: We need to select a random victim
* and remove it. The order of the elements is not important, so instead
*/
final int size = fRandomAccess.size();
final int pos = fRnd.nextInt(size);
- final CtfTmfLightweightContext victim = fRandomAccess.get(pos);
+ final CtfTmfContext victim = fRandomAccess.get(pos);
fRandomAccess.set(pos, context);
final CtfIterator elem = fMap.remove(victim);
fMap.put(context, elem);
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.ctfadaptor;
+
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
+
+/**
+ * Lightweight Context for CtfTmf traces. Should only use 3 references, 1 ref to
+ * a boxed Long, a long and an int.
+ *
+ * @author Matthew Khouzam
+ * @version 1.0
+ * @since 2.0
+ */
+public class CtfTmfContext implements ITmfContext {
+
+ // -------------------------------------------
+ // Fields
+ // -------------------------------------------
+
+ private CtfLocation curLocation;
+ private long curRank;
+
+ private final CtfTmfTrace fTrace;
+
+ // -------------------------------------------
+ // Constructor
+ // -------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @param ctfTmfTrace
+ * the parent trace
+ * @since 1.1
+ */
+ public CtfTmfContext(CtfTmfTrace ctfTmfTrace) {
+ fTrace = ctfTmfTrace;
+ curLocation = new CtfLocation(new CtfLocationData(0, 0));
+ }
+
+ // -------------------------------------------
+ // TmfContext Overrides
+ // -------------------------------------------
+
+ @Override
+ public long getRank() {
+ return curRank;
+ }
+
+ @Override
+ public ITmfLocation getLocation() {
+ return curLocation;
+ }
+
+ @Override
+ public boolean hasValidRank() {
+ return curRank != CtfLocation.INVALID_LOCATION.getTimestamp();
+ }
+
+ @Override
+ public void setLocation(ITmfLocation location) {
+ curLocation = (CtfLocation) location;
+ if (curLocation != null) {
+ getIterator().seek(curLocation.getLocationInfo());
+ }
+ }
+
+ @Override
+ public void setRank(long rank) {
+ curRank = rank;
+
+ }
+
+ @Override
+ public void increaseRank() {
+ if (hasValidRank()) {
+ curRank++;
+ }
+ }
+
+ // -------------------------------------------
+ // CtfTmfTrace Helpers
+ // -------------------------------------------
+
+ /**
+ * Gets the trace of this context.
+ *
+ * @return The trace of this context
+ */
+ public CtfTmfTrace getTrace() {
+ return fTrace;
+ }
+
+ /**
+ * Gets the current event. Wrapper to help CtfTmfTrace
+ *
+ * @return The event or null
+ */
+ public synchronized CtfTmfEvent getCurrentEvent() {
+ return getIterator().getCurrentEvent();
+ }
+
+ /**
+ * Advances to a the next event. Wrapper to help CtfTmfTrace
+ *
+ * @return success or not
+ */
+ public synchronized boolean advance() {
+ final CtfLocationData curLocationData = this.curLocation.getLocationInfo();
+ boolean retVal = getIterator().advance();
+ CtfTmfEvent currentEvent = getIterator().getCurrentEvent();
+
+ if (currentEvent != null) {
+ final long timestampValue = currentEvent.getTimestamp().getValue();
+ if (curLocationData.getTimestamp() == timestampValue) {
+ curLocation = new CtfLocation(timestampValue, curLocationData.getIndex() + 1);
+ } else {
+ curLocation = new CtfLocation(timestampValue, 0L);
+ }
+ } else {
+ curLocation = new CtfLocation(CtfLocation.INVALID_LOCATION);
+ }
+
+ return retVal;
+ }
+
+ @Override
+ public void dispose() {
+ // do nothing
+ }
+
+ /**
+ * Seeks to a given timestamp. Wrapper to help CtfTmfTrace
+ *
+ * @param timestamp
+ * desired timestamp
+ * @return success or not
+ */
+ public synchronized boolean seek(final long timestamp) {
+ curLocation = new CtfLocation(timestamp, 0);
+ return getIterator().seek(timestamp);
+ }
+
+ /**
+ * Seeks to a given location. Wrapper to help CtfTmfTrace
+ * @param location
+ * unique location to find the event.
+ *
+ * @return success or not
+ * @since 2.0
+ */
+ public synchronized boolean seek(final CtfLocationData location) {
+ curLocation = new CtfLocation(location);
+ return getIterator().seek(location);
+ }
+
+ @Override
+ public CtfTmfContext clone() {
+ CtfTmfContext ret = null;
+ try {
+ ret = (CtfTmfContext) super.clone();
+ /* Fields are immutable, no need to deep-copy them */
+ } catch (CloneNotSupportedException e) {
+ /* Should not happen, we're calling Object.clone() */
+ }
+ return ret;
+ }
+
+ // -------------------------------------------
+ // Private helpers
+ // -------------------------------------------
+
+ /**
+ * Get iterator, called every time to get an iterator, no local copy is
+ * stored so that there is no need to "update"
+ *
+ * @return an iterator
+ */
+ private CtfIterator getIterator() {
+ return CtfIteratorManager.getIterator(fTrace, this);
+ }
+}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Matthew Khouzam - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.ctfadaptor;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-
-import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-
-/**
- * Lightweight Context for CtfTmf traces. Should only use 3 references, 1 ref to
- * a boxed Long, a long and an int.
- *
- * @version 1.0
- * @author Matthew Khouzam
- */
-public class CtfTmfLightweightContext implements ITmfContext {
-
- // -------------------------------------------
- // Fields
- // -------------------------------------------
- private CtfLocation curLocation;
- private long curRank;
-
- private final CtfTmfTrace fTrace;
-
- // -------------------------------------------
- // Constructor
- // -------------------------------------------
- /**
- * Deprecated, use CtfTmfLightweightContext( CtfTmfTrace please )
- *
- * @param iters
- * the shared iterator pool.
- * @param pos
- * the iterator position.
- */
- @Deprecated
- public CtfTmfLightweightContext(ArrayList<CtfIterator> iters,
- ListIterator<CtfIterator> pos) {
- fTrace = iters.get(0).getCtfTmfTrace();
- curLocation = new CtfLocation(new CtfLocationData(0, 0));
- }
-
- /**
- *
- * @param ctfTmfTrace
- * the parent trace
- * @since 1.1
- */
- public CtfTmfLightweightContext(CtfTmfTrace ctfTmfTrace) {
- fTrace = ctfTmfTrace;
- curLocation = new CtfLocation(new CtfLocationData(0, 0));
- }
-
- // -------------------------------------------
- // TmfContext Overrides
- // -------------------------------------------
-
- @Override
- public long getRank() {
- return curRank;
- }
-
- @Override
- public ITmfLocation getLocation() {
- return curLocation;
- }
-
- @Override
- public boolean hasValidRank() {
- return curRank != CtfLocation.INVALID_LOCATION.getTimestamp();
- }
-
- @Override
- public void setLocation(ITmfLocation location) {
- curLocation = (CtfLocation) location;
- if (curLocation != null) {
- getIterator().seek(curLocation.getLocationInfo());
- }
- }
-
- @Override
- public void setRank(long rank) {
- curRank = rank;
-
- }
-
- @Override
- public void increaseRank() {
- if (hasValidRank()) {
- curRank++;
- }
- }
-
- // -------------------------------------------
- // CtfTmfTrace Helpers
- // -------------------------------------------
-
- /**
- * Gets the current event. Wrapper to help CtfTmfTrace
- *
- * @return The event or null
- */
- public synchronized CtfTmfEvent getCurrentEvent() {
- return getIterator().getCurrentEvent();
- }
-
- /**
- * Advances to a the next event. Wrapper to help CtfTmfTrace
- *
- * @return success or not
- */
- public synchronized boolean advance() {
- final CtfLocationData curLocationData = this.curLocation.getLocationInfo();
- boolean retVal = getIterator().advance();
- CtfTmfEvent currentEvent = getIterator().getCurrentEvent();
-
- if (currentEvent != null) {
- final long timestampValue = currentEvent.getTimestamp().getValue();
- if (curLocationData.getTimestamp() == timestampValue) {
- curLocation = new CtfLocation(timestampValue, curLocationData.getIndex() + 1);
- } else {
- curLocation = new CtfLocation(timestampValue, 0L);
- }
- } else {
- curLocation = new CtfLocation(CtfLocation.INVALID_LOCATION);
- }
-
- return retVal;
- }
-
- @Override
- public void dispose() {
- // do nothing
- }
-
- /**
- * Seeks to a given timestamp. Wrapper to help CtfTmfTrace
- *
- * @param timestamp
- * desired timestamp
- * @return success or not
- */
- public synchronized boolean seek(final long timestamp) {
- curLocation = new CtfLocation(timestamp, 0);
- return getIterator().seek(timestamp);
- }
-
- /**
- * Seeks to a given location. Wrapper to help CtfTmfTrace
- * @param location
- * unique location to find the event.
- *
- * @return success or not
- * @since 2.0
- */
- public synchronized boolean seek(final CtfLocationData location) {
- curLocation = new CtfLocation(location);
- return getIterator().seek(location);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#clone()
- */
- @Override
- public CtfTmfLightweightContext clone() {
- CtfTmfLightweightContext ret = new CtfTmfLightweightContext(fTrace);
- ret.curLocation = curLocation.clone();
- ret.curRank = curRank;
- return ret;
- }
-
- // -------------------------------------------
- // Private helpers
- // -------------------------------------------
- /**
- * Get iterator, called every time to get an iterator, no local copy is
- * stored so that there is no need to "update"
- *
- * @return an iterator
- */
- private CtfIterator getIterator() {
- return CtfIteratorManager.getIterator(fTrace, this);
- }
-}
try {
this.fTrace = new CTFTrace(path);
CtfIteratorManager.addTrace(this);
- CtfTmfLightweightContext ctx;
+ CtfTmfContext ctx;
/* Set the start and (current) end times for this trace */
- ctx = (CtfTmfLightweightContext) seekEvent(0L);
+ ctx = (CtfTmfContext) seekEvent(0L);
CtfTmfEvent event = getNext(ctx);
if((ctx.getLocation().equals(CtfIterator.NULL_LOCATION)) || (ctx.getCurrentEvent() == null)) {
/* Handle the case where the trace is empty */
@Override
public double getLocationRatio(ITmfLocation location) {
final CtfLocation curLocation = (CtfLocation) location;
- final CtfTmfLightweightContext context = new CtfTmfLightweightContext(this);
+ final CtfTmfContext context = new CtfTmfContext(this);
context.setLocation(curLocation);
context.seek(curLocation.getLocationInfo());
final CtfLocationData currentTime = ((CtfLocationData)context.getLocation().getLocationInfo());
@Override
public synchronized ITmfContext seekEvent(final ITmfLocation location) {
CtfLocation currentLocation = (CtfLocation) location;
- CtfTmfLightweightContext context = new CtfTmfLightweightContext(this);
+ CtfTmfContext context = new CtfTmfContext(this);
if (fTrace == null) {
context.setLocation(null);
context.setRank(ITmfContext.UNKNOWN_RANK);
@Override
public synchronized ITmfContext seekEvent(double ratio) {
- CtfTmfLightweightContext context = new CtfTmfLightweightContext(this);
+ CtfTmfContext context = new CtfTmfContext(this);
if (fTrace == null) {
context.setLocation(null);
context.setRank(ITmfContext.UNKNOWN_RANK);
return null;
}
CtfTmfEvent event = null;
- if (context instanceof CtfTmfLightweightContext) {
+ if (context instanceof CtfTmfContext) {
if (context.getLocation() == null || CtfLocation.INVALID_LOCATION.equals(context.getLocation().getLocationInfo())) {
return null;
}
- CtfTmfLightweightContext ctfContext = (CtfTmfLightweightContext) context;
+ CtfTmfContext ctfContext = (CtfTmfContext) context;
event = ctfContext.getCurrentEvent();
if (event != null) {
@Override
public CtfTmfEvent parseEvent(ITmfContext context) {
CtfTmfEvent event = null;
- if( context instanceof CtfTmfLightweightContext ){
- CtfTmfLightweightContext itt = (CtfTmfLightweightContext) context.clone();
+ if( context instanceof CtfTmfContext ){
+ CtfTmfContext itt = (CtfTmfContext) context.clone();
event = itt.getCurrentEvent();
}
return event;
// Helpers
//-------------------------------------------
- private static CtfIterator getIterator(CtfTmfTrace trace, CtfTmfLightweightContext context) {
+ private static CtfIterator getIterator(CtfTmfTrace trace, CtfTmfContext context) {
return CtfIteratorManager.getIterator(trace, context);
}
*
* @see ITmfLocation
*/
-public interface ITmfContext {
+public interface ITmfContext extends Cloneable {
// ------------------------------------------------------------------------
// Constants
*
* @see ITmfLocation
*/
-public class TmfContext implements ITmfContext, Cloneable {
+public class TmfContext implements ITmfContext {
// ------------------------------------------------------------------------
// Attributes