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