o.e.l.tmf.ui: Utils.findEvent no longer return null when previous ITimeEvent has...
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / ctfadaptor / CtfTmfEventField.java
index 177654b049530ba9fefbaf0b44415f200382f027..75924c3eadc82b039ac2914b8565ce4e44b0b578 100644 (file)
@@ -15,6 +15,9 @@
 
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.linuxtools.ctf.core.event.types.ArrayDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.ArrayDefinition;
 import org.eclipse.linuxtools.ctf.core.event.types.Definition;
@@ -40,16 +43,16 @@ public abstract class CtfTmfEventField implements ITmfEventField {
     // Class attributes
     // ------------------------------------------------------------------------
 
-    /** @since 2.0 */
+    /** @since 1.2 */
     protected static final int FIELDTYPE_INTEGER = 0;
 
-    /** @since 2.0 */
+    /** @since 1.2 */
     protected static final int FIELDTYPE_STRING = 1;
 
-    /** @since 2.0 */
+    /** @since 1.2 */
     protected static final int FIELDTYPE_INTEGER_ARRAY = 2;
 
-    /** @since 2.0 */
+    /** @since 1.2 */
     protected static final int FIELDTYPE_FLOAT = 3;
 
     /** @since 2.0 */
@@ -59,6 +62,7 @@ public abstract class CtfTmfEventField implements ITmfEventField {
     // Attributes
     // ------------------------------------------------------------------------
 
+    /** The name of this field */
     protected final String name;
 
     // ------------------------------------------------------------------------
@@ -188,7 +192,7 @@ public abstract class CtfTmfEventField implements ITmfEventField {
                     other.name);
         case FIELDTYPE_INTEGER_ARRAY:
             return new CTFIntegerArrayField(
-                    ((CTFIntegerArrayField) other).getValue(), other.name);
+                    ((CTFIntegerArrayField) other).getLongValues(), other.name);
         case FIELDTYPE_FLOAT:
             return new CTFFloatField(((CTFFloatField) other).getValue(),
                     other.name);
@@ -396,22 +400,32 @@ final class CTFIntegerArrayField extends CtfTmfEventField {
         return FIELDTYPE_INTEGER_ARRAY;
     }
 
-    @Override
-    public long[] getValue() {
+    /**
+     * Gets the values of the array
+     * @return the values in the array
+     *
+     * @since 2.0
+     */
+    long[] getLongValues() {
         return this.longValues;
     }
 
+    @Override
+    public List<Long> getValue() {
+        List<Long> retVal = new ArrayList<Long>();
+        for( Long l : longValues){
+            retVal.add(l);
+        }
+        return retVal;
+    }
+
     @Override
     public String toString() {
         StringBuffer buffer = new StringBuffer();
-        buffer.append("{ "); //$NON-NLS-1$
-
-        buffer.append(longValues[0]);
-        for (int i = 1; i < longValues.length; i++) {
-            buffer.append(", " + longValues[i]); //$NON-NLS-1$
-        }
-        buffer.append('}');
-        return name + '=' + buffer.toString();
+        buffer.append(name);
+        buffer.append('=');
+        buffer.append(getValue());
+        return buffer.toString();
     }
 }
 
This page took 0.052289 seconds and 5 git commands to generate.