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;
// 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 */
// Attributes
// ------------------------------------------------------------------------
+ /** The name of this field */
protected final String name;
// ------------------------------------------------------------------------
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);
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();
}
}