Commit | Line | Data |
---|---|---|
5179fc01 FC |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 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 | * <b><u>ITmfEventField</u></b> | |
17 | * <p> | |
4c564a2d FC |
18 | * The TMF event payload structure. Each field can be either a terminal or |
19 | * further decomposed into subfields. | |
5179fc01 | 20 | */ |
7636a88e | 21 | public interface ITmfEventField extends Cloneable { |
5179fc01 | 22 | |
a4115405 FC |
23 | // ------------------------------------------------------------------------ |
24 | // Constants | |
25 | // ------------------------------------------------------------------------ | |
26 | ||
4c564a2d FC |
27 | /** |
28 | * The root field id (the main container) | |
29 | */ | |
a4115405 | 30 | public static final String ROOT_FIELD_ID = ":root:"; //$NON-NLS-1$ |
085d898f | 31 | |
a4115405 FC |
32 | // ------------------------------------------------------------------------ |
33 | // Getters | |
34 | // ------------------------------------------------------------------------ | |
35 | ||
5179fc01 | 36 | /** |
d7dbf09a | 37 | * @return the field name |
5179fc01 | 38 | */ |
4c564a2d | 39 | public String getName(); |
5179fc01 FC |
40 | |
41 | /** | |
42 | * @return the field value | |
43 | */ | |
44 | public Object getValue(); | |
45 | ||
46 | /** | |
75d42a16 | 47 | * @return the list of subfield names (empty if none) |
4c564a2d FC |
48 | */ |
49 | public String[] getFieldNames(); | |
50 | ||
51 | /** | |
52 | * @return the nth field name (null if absent or inexistent) | |
53 | */ | |
54 | public String getFieldName(int index); | |
55 | ||
56 | /** | |
75d42a16 | 57 | * @return the list of subfields (null if none) |
4c564a2d FC |
58 | */ |
59 | public ITmfEventField[] getFields(); | |
60 | ||
61 | /** | |
62 | * @return a specific subfield by name (null if absent or inexistent) | |
63 | */ | |
64 | public ITmfEventField getField(String name); | |
65 | ||
66 | /** | |
67 | * @return a specific subfield by index (null if absent or inexistent) | |
5179fc01 | 68 | */ |
4c564a2d | 69 | public ITmfEventField getField(int index); |
5179fc01 | 70 | |
a4115405 FC |
71 | // ------------------------------------------------------------------------ |
72 | // Cloneable | |
73 | // ------------------------------------------------------------------------ | |
74 | ||
7636a88e | 75 | /** |
76 | * @return a clone of the event type | |
77 | */ | |
cbbcc354 | 78 | public ITmfEventField clone(); |
7636a88e | 79 | |
5179fc01 | 80 | } |