*/
public abstract class SimpleDatatypeDefinition extends Definition {
+ /**
+ * Create a new SimpleDatatypeDefinition
+ *
+ * @param definitionScope
+ * The scope of this definition
+ * @param fieldName
+ * The name of the field matching this definition in the parent
+ * scope
+ */
public SimpleDatatypeDefinition(IDefinitionScope definitionScope,
String fieldName) {
super(definitionScope, fieldName);
package org.eclipse.linuxtools.internal.ctf.core.trace;
import java.util.HashMap;
+import java.util.Map;
/**
* <b><u>StreamInputPacketIndexEntry</u></b>
// Attributes
// ------------------------------------------------------------------------
-
/**
* Offset of the packet in the file, in bytes
*/
private String target ;
private long targetID;
+ /**
+ * Attributes of this index entry
+ */
+ private final Map<String, Object> attributes = new HashMap<String, Object>();
+
// ------------------------------------------------------------------------
// Constructors
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 atrribute
+ * @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;
}