X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.ctf.core%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Finternal%2Fctf%2Fcore%2Ftrace%2FStreamInputPacketIndexEntry.java;h=3a0379082351e5698953c6ca79820ec42fc9d9f4;hb=132a02b0c1e609dc72cb8f06f74aa8ef2809ca7f;hp=beb6268e20ebfad4d9acb49a219af7a336665a6c;hpb=21fb02fa6de85c333c89d52e5a0aa1593c56dae4;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java b/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java index beb6268e20..3a03790823 100644 --- a/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java +++ b/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/StreamInputPacketIndexEntry.java @@ -13,6 +13,7 @@ package org.eclipse.linuxtools.internal.ctf.core.trace; import java.util.HashMap; +import java.util.Map; /** * StreamInputPacketIndexEntry @@ -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 attributes = new HashMap(); + // ------------------------------------------------------------------------ // 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 attributes = new HashMap(); + /** + * 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; }