*/
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
// ------------------------------------------------------------------------
list.add(curField);
}
field = new CTFStructField(fieldName, list.toArray(new CtfTmfEventField[list.size()]));
+
} else if (fieldDef instanceof VariantDefinition) {
VariantDefinition varDef = (VariantDefinition) fieldDef;
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
*
this.base = base;
}
- @Override
- public int getFieldType() {
- return FIELDTYPE_INTEGER;
- }
-
@Override
public Long getValue() {
return (Long) super.getValue();
super(name, strValue, null);
}
- @Override
- public int getFieldType() {
- return FIELDTYPE_STRING;
- }
-
@Override
public String getValue() {
return (String) super.getValue();
this.base = base;
}
- @Override
- public int getFieldType() {
- return FIELDTYPE_INTEGER_ARRAY;
- }
-
@Override
public List<Long> getValue() {
return (List<Long>) super.getValue();
super(name, value, null);
}
- @Override
- public int getFieldType() {
- return FIELDTYPE_FLOAT;
- }
-
@Override
public Double getValue() {
return (Double) super.getValue();
enumValue.getSecond().longValue()), null);
}
- @Override
- public int getFieldType() {
- return FIELDTYPE_ENUM;
- }
-
@Override
public CtfEnumPair getValue() {
return (CtfEnumPair) super.getValue();
super(name, fields, fields);
}
- @Override
- public int getFieldType() {
- return FIELDTYPE_STRUCT;
- }
-
@Override
public CtfTmfEventField[] getValue() {
return (CtfTmfEventField[]) super.getValue();