package org.eclipse.linuxtools.ctf.core.trace;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import java.util.PriorityQueue;
import java.util.Set;
-import java.util.Vector;
import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
import org.eclipse.linuxtools.internal.ctf.core.Activator;
/**
* Vector of all the trace file readers.
*/
- private final Vector<StreamInputReader> streamInputReaders = new Vector<StreamInputReader>();
+ private final List<StreamInputReader> streamInputReaders = new ArrayList<StreamInputReader>();
/**
* Priority queue to order the trace file readers by timestamp.
*/
- protected PriorityQueue<StreamInputReader> prio;
+ private PriorityQueue<StreamInputReader> prio;
/**
* Array to count the number of event per trace file.
* Get the start Time of this trace bear in mind that the trace could be
* empty.
*/
- this.startTime = 0;// prio.peek().getPacketReader().getCurrentPacket().getTimestampBegin();
+ this.startTime = 0;
if (hasMoreEvents()) {
this.startTime = prio.peek().getCurrentEvent().getTimestamp();
this.setEndTime(this.startTime);
* @param endTime
* The end time to use
*/
- protected void setEndTime(long endTime) {
+ protected final void setEndTime(long endTime) {
this.endTime = endTime;
}
+ /**
+ * Get the priority queue of this trace reader.
+ *
+ * @return The priority queue of input readers
+ * @since 2.0
+ */
+ protected PriorityQueue<StreamInputReader> getPrio() {
+ return prio;
+ }
+
// ------------------------------------------------------------------------
// Operations
return hasMoreEvents();
}
-// /**
-// * Go to the first entry of a trace
-// *
-// * @return 0, the first index.
-// */
-// private long goToZero() {
-// long tempIndex;
-// for (StreamInputReader streamInputReader : this.streamInputReaders) {
-// /*
-// * Seek the trace reader.
-// */
-// streamInputReader.seek(0);
-// }
-// tempIndex = 0;
-// return tempIndex;
-// }
-
/**
* gets the stream with the oldest event
*
*
* @return true if yes.
*/
- public boolean hasMoreEvents() {
+ public final boolean hasMoreEvents() {
return this.prio.size() > 0;
}
long len = (width * this.eventCountPerTraceFile[se.getName()])
/ numEvents;
- StringBuilder sb = new StringBuilder(se.getFilename() + "\t["); //$NON-NLS-1$
+ StringBuilder sb = new StringBuilder(se.getFilename());
+ sb.append("\t["); //$NON-NLS-1$
for (int i = 0; i < len; i++) {
sb.append('+');