tmf: Remove getFieldType() method from CTF event fields
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Fri, 22 Mar 2013 22:09:11 +0000 (18:09 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 4 Apr 2013 16:04:23 +0000 (12:04 -0400)
It's not used anywhere. If we ever need it in the future, it would
be better to use an enum.

Change-Id: I6e6e4b8f4a8598536c4b5d5a762ef41eb2ffb989
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/11404

org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java

index 193025efe5c85dc0b9dadd2316f163e5aa5ada2a..3485d5f8f4348d55b87d335f33fca36045752c29 100644 (file)
@@ -45,28 +45,6 @@ import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
  */
 public abstract class CtfTmfEventField extends TmfEventField {
 
-    // ------------------------------------------------------------------------
-    // Class attributes
-    // ------------------------------------------------------------------------
-
-    /** @since 1.2 */
-    protected static final int FIELDTYPE_INTEGER = 0;
-
-    /** @since 1.2 */
-    protected static final int FIELDTYPE_STRING = 1;
-
-    /** @since 1.2 */
-    protected static final int FIELDTYPE_INTEGER_ARRAY = 2;
-
-    /** @since 1.2 */
-    protected static final int FIELDTYPE_FLOAT = 3;
-
-    /** @since 2.0 */
-    protected static final int FIELDTYPE_ENUM = 4;
-
-    /** @since 2.0 */
-    protected static final int FIELDTYPE_STRUCT = 5;
-
     // ------------------------------------------------------------------------
     // Constructor
     // ------------------------------------------------------------------------
@@ -177,6 +155,7 @@ public abstract class CtfTmfEventField extends TmfEventField {
                 list.add(curField);
             }
             field = new CTFStructField(fieldName, list.toArray(new CtfTmfEventField[list.size()]));
+
         } else if (fieldDef instanceof VariantDefinition) {
             VariantDefinition varDef = (VariantDefinition) fieldDef;
 
@@ -201,17 +180,6 @@ public abstract class CtfTmfEventField extends TmfEventField {
         return getName() + '=' + getValue().toString();
     }
 
-    // ------------------------------------------------------------------------
-    // Abstract methods (to be implemented by each specific field type)
-    // ------------------------------------------------------------------------
-
-    /**
-     * Return the int representing this field's value type
-     *
-     * @return The field type
-     */
-    public abstract int getFieldType();
-
     /**
      * Print a numeric value as a string in a given base
      *
@@ -271,11 +239,6 @@ final class CTFIntegerField extends CtfTmfEventField {
         this.base = base;
     }
 
-    @Override
-    public int getFieldType() {
-        return FIELDTYPE_INTEGER;
-    }
-
     @Override
     public Long getValue() {
         return (Long) super.getValue();
@@ -314,11 +277,6 @@ final class CTFStringField extends CtfTmfEventField {
         super(name, strValue, null);
     }
 
-    @Override
-    public int getFieldType() {
-        return FIELDTYPE_STRING;
-    }
-
     @Override
     public String getValue() {
         return (String) super.getValue();
@@ -349,11 +307,6 @@ final class CTFIntegerArrayField extends CtfTmfEventField {
         this.base = base;
     }
 
-    @Override
-    public int getFieldType() {
-        return FIELDTYPE_INTEGER_ARRAY;
-    }
-
     @Override
     public List<Long> getValue() {
         return (List<Long>) super.getValue();
@@ -399,11 +352,6 @@ final class CTFFloatField extends CtfTmfEventField {
         super(name, value, null);
     }
 
-    @Override
-    public int getFieldType() {
-        return FIELDTYPE_FLOAT;
-    }
-
     @Override
     public Double getValue() {
         return (Double) super.getValue();
@@ -430,11 +378,6 @@ final class CTFEnumField extends CtfTmfEventField {
                                     enumValue.getSecond().longValue()), null);
     }
 
-    @Override
-    public int getFieldType() {
-        return FIELDTYPE_ENUM;
-    }
-
     @Override
     public CtfEnumPair getValue() {
         return (CtfEnumPair) super.getValue();
@@ -460,11 +403,6 @@ final class CTFStructField extends CtfTmfEventField {
         super(name, fields, fields);
     }
 
-    @Override
-    public int getFieldType() {
-        return FIELDTYPE_STRUCT;
-    }
-
     @Override
     public CtfTmfEventField[] getValue() {
         return (CtfTmfEventField[]) super.getValue();
This page took 0.026831 seconds and 5 git commands to generate.