/*******************************************************************************
- * Copyright (c) 2012 Ericsson
- *
+ * Copyright (c) 2012, 2013 Ericsson
+ *
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Francois Chouinard - Initial API and implementation
*******************************************************************************/
package org.eclipse.linuxtools.tmf.core.event;
-
/**
- * The TMF event payload structure. Each field can be either a terminal or
+ * The generic event payload in TMF. Each field can be either a terminal or
* further decomposed into subfields.
- *
- * @since 1.0
+ *
* @version 1.0
* @author Francois Chouinard
*
- * @see TmfEventField
* @see ITmfEvent
+ * @see ITmfEventType
*/
-public interface ITmfEventField extends Cloneable {
+public interface ITmfEventField {
// ------------------------------------------------------------------------
// Constants
/**
* @return the field name
*/
- public String getName();
+ String getName();
/**
* @return the field value
*/
- public Object getValue();
+ Object getValue();
+
+ /**
+ * @return the value formatted as string
+ * @since 2.0
+ */
+ String getFormattedValue();
/**
- * @return the list of subfield names (empty if none)
+ * @return the list of subfield names (empty array if none)
*/
- public String[] getFieldNames();
+ String[] getFieldNames();
/**
+ * @param index The index of the field
* @return the nth field name (null if absent or inexistent)
*/
- public String getFieldName(int index);
+ String getFieldName(int index);
/**
- * @return the list of subfields (null if none)
+ * @return the list of subfields (empty array if none)
*/
- public ITmfEventField[] getFields();
+ ITmfEventField[] getFields();
/**
+ * @param name The name of the field
* @return a specific subfield by name (null if absent or inexistent)
*/
- public ITmfEventField getField(String name);
+ ITmfEventField getField(String name);
/**
+ * @param index The index of the field to return
* @return a specific subfield by index (null if absent or inexistent)
*/
- public ITmfEventField getField(int index);
-
- // ------------------------------------------------------------------------
- // Cloneable
- // ------------------------------------------------------------------------
+ ITmfEventField getField(int index);
/**
- * @return a clone of the event type
+ * Gets the a sub-field of this field, which may be multiple levels down.
+ *
+ * @param path
+ * Array of field names to recursively go through
+ * @return The field at the end, or null if a field in the path cannot be
+ * found
+ * @since 3.0
*/
- public ITmfEventField clone();
+ ITmfEventField getSubField(String[] path);
}