ctf: Fix lost events in a more elegant way
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / internal / ctf / core / trace / StreamInputPacketIndexEntry.java
index beb6268e20ebfad4d9acb49a219af7a336665a6c..3a0379082351e5698953c6ca79820ec42fc9d9f4 100644 (file)
@@ -13,6 +13,7 @@
 package org.eclipse.linuxtools.internal.ctf.core.trace;
 
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  * <b><u>StreamInputPacketIndexEntry</u></b>
@@ -25,7 +26,6 @@ public class StreamInputPacketIndexEntry {
     // Attributes
     // ------------------------------------------------------------------------
 
-
     /**
      * Offset of the packet in the file, in bytes
      */
@@ -67,6 +67,11 @@ public class StreamInputPacketIndexEntry {
     private String target ;
     private long targetID;
 
+    /**
+     * Attributes of this index entry
+     */
+    private final Map<String, Object> attributes = new HashMap<String, Object>();
+
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -198,7 +203,7 @@ public class StreamInputPacketIndexEntry {
     }
 
     /**
-     * @return the lostEvents
+     * @return the lostEvents in this packet
      */
     public long getLostEvents() {
         return lostEvents;
@@ -211,23 +216,50 @@ public class StreamInputPacketIndexEntry {
         this.lostEvents = lostEvents;
     }
 
-    private final HashMap<String, Object> attributes = new HashMap<String, Object>();
+    /**
+     * Add an attribute to this index entry
+     *
+     * @param field
+     *            The name of the attribute
+     * @param value
+     *            The value to insert
+     */
     public void addAttribute(String field, Object value) {
         attributes.put(field, value);
     }
+
+    /**
+     * Retrieve the value of an existing attribute
+     *
+     * @param field
+     *            The name of the attribute
+     * @return The value that was stored, or null if it wasn't found
+     */
     public Object lookupAttribute(String field){
         return attributes.get(field);
     }
 
+    /**
+     * @return The target that is being traced
+     */
     public String getTarget() {
         return target;
     }
 
+    /**
+     * Assign a target to this index entry
+     *
+     * @param target
+     *            The target to assign
+     */
     public void setTarget(String target) {
         this.target = target;
         this.targetID = Integer.parseInt(target.replaceAll("[\\D]", "")); //$NON-NLS-1$ //$NON-NLS-2$ // slow
     }
 
+    /**
+     * @return The ID of the target
+     */
     public long getTargetId(){
         return targetID;
     }
This page took 0.025951 seconds and 5 git commands to generate.