Long aLong = 12345L;
TmfTimestamp aTimestamp = new TmfTimestamp();
- TmfLocation<Boolean> fLocation0;
TmfLocation<String> fLocation1;
TmfLocation<String> fLocation2;
TmfLocation<Long> fLocation3;
@Override
protected void setUp() throws Exception {
super.setUp();
- fLocation0 = TmfLocation.NULL_LOCATION;
fLocation1 = new TmfLocation<String>((String) null);
fLocation2 = new TmfLocation<String>(aString);
fLocation3 = new TmfLocation<Long>(aLong);
// ------------------------------------------------------------------------
public void testTmfLocation() {
- assertNull("TmfLocation", fLocation0.getLocation());
assertNull("TmfLocation", fLocation1.getLocation());
assertEquals("TmfLocation", aString, fLocation2.getLocation());
assertEquals("TmfLocation", aLong, fLocation3.getLocation());
}
public void testTmfLocationCopy() {
- TmfLocation<Boolean> location0 = new TmfLocation<Boolean>(fLocation0);
TmfLocation<String> location1 = new TmfLocation<String>(fLocation1);
TmfLocation<String> location2 = new TmfLocation<String>(fLocation2);
TmfLocation<Long> location3 = new TmfLocation<Long>(fLocation3);
TmfLocation<ITmfTimestamp> location4 = new TmfLocation<ITmfTimestamp>(fLocation4);
- assertNull("TmfLocation", location0.getLocation());
assertNull("TmfLocation", location1.getLocation());
assertEquals("TmfLocation", aString, location2.getLocation());
assertEquals("TmfLocation", aLong, location3.getLocation());
* @author Francois Chouinard
*
* @see ITmfEvent
- * @see ITmfEventField
+ * @see ITmfEventType
*/
public interface ITmfEventField extends Cloneable {
package org.eclipse.linuxtools.tmf.core.event;
/**
- * A simplified timestamp where scale and precision are set to 0 i.e. timestamps
- * are represented by the tuple { value, 0, 0 }.
+ * A simplified timestamp where scale and precision are set to 0.
*
* @since 1.0
* @version 1.0
/*******************************************************************************
- * Copyright (c) 2009 Ericsson
+ * Copyright (c) 2009, 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
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
/**
- * The TMF trace parser API.
- *
+ * The generic trace parser in TMF.
+ *
* @since 1.0
* @version 1.0
* @author Francois Chouinard
/**
* Parses the trace event referenced by the context.
+ * The context should *not* be altered.
*
- * @param context
- * @return
+ * @param context the trace context
+ * @return a parsed event (null if none)
*/
public T parseEvent(ITmfContext context);
/**
+ * The generic trace location in TMF.
+ * <p>
* An ITmfLocation is the equivalent of a random-access file position, holding
* enough information to allow the positioning of the trace 'pointer' to read an
* arbitrary event.
* <p>
- * This location is trace-specific but must be comparable.
+ * This location is trace-specific and must be comparable.
*
* @since 1.0
* @version 1.0
* ITmfEvent event = trace.readEvent(context);
* while (event != null) {
* processEvent(event);
- * event = trace.readEvent(context);
+ * event = trace.readNextEvent(context);
* }
* </pre>
* <b>Example 2</b>: Process 50 events starting from the 1000th event
* <pre>
* int nbEventsRead = 0;
* ITmfContext context = trace.seekEvent(1000);
- * ITmfEvent event = trace.readEvent(context);
+ * ITmfEvent event = trace.readNextEvent(context);
* while (event != null && nbEventsRead < 50) {
* nbEventsRead++;
* processEvent(event);
- * event = trace.readEvent(context);
+ * event = trace.readNextEvent(context);
* }
* </pre>
* <b>Example 3</b>: Process the events between 2 timestamps (inclusive)
* ITmfTimestamp startTime = ...;
* ITmfTimestamp endTime = ...;
* ITmfContext context = trace.seekEvent(startTime);
- * ITmfEvent event = trace.readEvent(context);
+ * ITmfEvent event = trace.readNextEvent(context);
* while (event != null && event.getTimestamp().compareTo(endTime) <= 0) {
* processEvent(event);
- * event = trace.readEvent(context);
+ * event = trace.readNextEvent(context);
* }
* </pre>
* A trace is also an event provider so it can process event requests
* @author Francois Chouinard
*
* @see ITmfEvent
- * @see ITmfEventProvider
+ * @see ITmfDataProvider
* @see ITmfEventRequest
* @see TmfTrace
*/
import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
/**
- * The trace indexer API.
+ * The generic trace indexer in TMF.
*
* @since 1.0
* @version 1.0
import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
/**
- * This class maps an event timestamp to a generic location.
+ * A basic implementation of ITmfCheckpoint. It simply maps an event timestamp
+ * to a generic location.
*
* @since 1.0
* @version 1.0
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceUpdatedSignal;
/**
- * A simple trace indexer that builds an array of trace checkpoints. Checkpoints
- * are stored at fixed intervals (event rank) in ascending timestamp order.
+ * A simple indexer that manages the trace index as an array of trace
+ * checkpoints. Checkpoints are stored at fixed intervals (event rank) in
+ * ascending timestamp order.
* <p>
* The goal being to access a random trace event reasonably fast from the user's
* standpoint, picking the right interval value becomes a trade-off between speed
package org.eclipse.linuxtools.tmf.core.trace;
/**
- * Trace context structure. It ties a trace location to an event rank. The
- * context should be enough to restore the trace state so the corresponding
- * event can be read.
+ * A basic implementation of ITmfContext.
+ * <p>
+ * It ties a trace location to an event rank. The context should be enough to
+ * restore the trace state so the corresponding event can be read.
*
* @since 1.0
* @version 1.0
* @author Francois Chouinard
*
- * @see ITmfContext
* @see ITmfLocation
*/
public class TmfContext implements ITmfContext, Cloneable {
* @since 1.0
* @version 1.0
* @author Francois Chouinard
- *
- * @see ITmfLocation
*/
public class TmfLocation<L extends Comparable<L>> implements ITmfLocation<L> {
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- /**
- * The 'null' location
- */
- static public final TmfLocation<Boolean> NULL_LOCATION = new TmfLocation<Boolean>();
-
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
/**
* Default constructor (for the 'null' location)
*/
+ @SuppressWarnings("unused")
private TmfLocation() {
fLocation = null;
}
/**
* Copy constructor
*
- * @param other the original location
+ * @param location the original location
*/
public TmfLocation(final TmfLocation<L> location) {
fLocation = location.fLocation;
* <li> public double getLocationRatio(ITmfLocation<?> location)
* <li> public ITmfContext seekEvent(ITmfLocation<?> location)
* <li> public ITmfContext seekEvent(double ratio)
+ * <li> public boolean validate(IProject project, String path)
* </ul>
* A concrete trace must provide its corresponding parser. A common way to
* accomplish this is by making the concrete class extend TmfTrace and
* @version 1.0
* @author Francois Chouinard
*
- * @see ITmfTrace
- * @see TmfEventProvider
* @see ITmfEvent
* @see ITmfTraceIndexer
* @see ITmfEventParser
private String fPath;
/**
- * The cache page size
+ * The trace cache page size
*/
protected int fCacheSize = DEFAULT_TRACE_CACHE_SIZE;
/**
- * The number of events collected so far
+ * The number of events collected (so far)
*/
protected long fNbEvents = 0;
* Update the trace attributes
*
* @param context the current trace context
- * @param rank
- * @param timestamp
+ * @param timestamp the corresponding timestamp
*/
protected synchronized void updateAttributes(final ITmfContext context, final ITmfTimestamp timestamp) {
if (fStartTime.compareTo(timestamp, false) > 0) {