Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Montplaisir2014-05-06 14:02:10 -0400
committerAlexandre Montplaisir2014-05-07 15:08:08 -0400
commit9463280a9796083dfb8dc2f9e2e78966bd79f6b9 (patch)
tree36bf68af0d685339865a59c1674b8da679c66449
parent49d910158f66ff1fa8267a71836aa4e28ec2cb81 (diff)
downloadorg.eclipse.linuxtools-9463280a9796083dfb8dc2f9e2e78966bd79f6b9.tar.gz
org.eclipse.linuxtools-9463280a9796083dfb8dc2f9e2e78966bd79f6b9.tar.xz
org.eclipse.linuxtools-9463280a9796083dfb8dc2f9e2e78966bd79f6b9.zip
tmf: Restore TextTraceEventContent.getField(int)
Commit 0554e04 moved the notion of field indexes down from the framework into the TextTraceEventContent. Since this class keeps the getFieldName(int) convenience method, getField(int) should also remain there. Change-Id: I5c30c18d605b6ee75e1867966a4fb8fdd5cdf2cd Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Reviewed-on: https://git.eclipse.org/r/26069 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java47
1 files changed, 31 insertions, 16 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java
index 9a45025fe9..b239b7b0a1 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/text/TextTraceEventContent.java
@@ -61,11 +61,12 @@ public class TextTraceEventContent implements ITmfEventField {
* @param fieldNames
* the array of field names
*/
- @SuppressWarnings("null") // Collections.EMPTY_LIST
private TextTraceEventContent(@NonNull String fieldName) {
fName = fieldName;
fValue = null;
- fFields = Collections.EMPTY_LIST;
+ @SuppressWarnings("null")
+ @NonNull List<TextTraceEventContent> fields = Collections.EMPTY_LIST;
+ fFields = fields;
}
// ------------------------------------------------------------------------
@@ -91,20 +92,6 @@ public class TextTraceEventContent implements ITmfEventField {
return fieldNames;
}
- /**
- * Get a field name by index
- *
- * @param index
- * The index of the field
- * @return The name of the field at that index
- */
- public String getFieldName(int index) {
- if (index >= 0 && index < fFields.size()) {
- return fFields.get(index).getName();
- }
- return null;
- }
-
@Override
public List<TextTraceEventContent> getFields() {
return new ArrayList<>(fFields);
@@ -143,6 +130,34 @@ public class TextTraceEventContent implements ITmfEventField {
// ------------------------------------------------------------------------
/**
+ * Get a field name by index
+ *
+ * @param index
+ * The index of the field
+ * @return The name of the field at that index
+ */
+ public String getFieldName(int index) {
+ if (index >= 0 && index < fFields.size()) {
+ return fFields.get(index).getName();
+ }
+ return null;
+ }
+
+ /**
+ * Get a field by index
+ *
+ * @param index
+ * The index of the field
+ * @return The field object at the requested index
+ */
+ public ITmfEventField getField(int index) {
+ if (index >= 0 && index < fFields.size()) {
+ return fFields.get(index);
+ }
+ return null;
+ }
+
+ /**
* Get a subfield value by name
*
* @param name

Back to the top