Merge branch 'master' into lttng-luna
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / event / ITmfEventField.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.event;
14
15 /**
16 * The generic event payload in TMF. Each field can be either a terminal or
17 * further decomposed into subfields.
18 *
19 * @version 1.0
20 * @author Francois Chouinard
21 *
22 * @see ITmfEvent
23 * @see ITmfEventType
24 */
25 public interface ITmfEventField {
26
27 // ------------------------------------------------------------------------
28 // Constants
29 // ------------------------------------------------------------------------
30
31 /**
32 * The root field id (the main container)
33 */
34 public static final String ROOT_FIELD_ID = ":root:"; //$NON-NLS-1$
35
36 // ------------------------------------------------------------------------
37 // Getters
38 // ------------------------------------------------------------------------
39
40 /**
41 * @return the field name
42 */
43 String getName();
44
45 /**
46 * @return the field value
47 */
48 Object getValue();
49
50 /**
51 * @return the value formatted as string
52 * @since 2.0
53 */
54 String getFormattedValue();
55
56 /**
57 * @return the list of subfield names (empty array if none)
58 */
59 String[] getFieldNames();
60
61 /**
62 * @param index The index of the field
63 * @return the nth field name (null if absent or inexistent)
64 */
65 String getFieldName(int index);
66
67 /**
68 * @return the list of subfields (empty array if none)
69 */
70 ITmfEventField[] getFields();
71
72 /**
73 * @param name The name of the field
74 * @return a specific subfield by name (null if absent or inexistent)
75 */
76 ITmfEventField getField(String name);
77
78 /**
79 * @param index The index of the field to return
80 * @return a specific subfield by index (null if absent or inexistent)
81 */
82 ITmfEventField getField(int index);
83
84 /**
85 * Gets the a sub-field of this field, which may be multiple levels down.
86 *
87 * @param path
88 * Array of field names to recursively go through
89 * @return The field at the end, or null if a field in the path cannot be
90 * found
91 * @since 3.0
92 */
93 ITmfEventField getSubField(String[] path);
94
95 }
This page took 0.03407 seconds and 5 git commands to generate.