| 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 | * 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 | public String getName(); |
| 44 | |
| 45 | /** |
| 46 | * @return the field value |
| 47 | */ |
| 48 | public Object getValue(); |
| 49 | |
| 50 | /** |
| 51 | * @return the list of subfield names (empty array if none) |
| 52 | */ |
| 53 | public String[] getFieldNames(); |
| 54 | |
| 55 | /** |
| 56 | * @return the nth field name (null if absent or inexistent) |
| 57 | */ |
| 58 | public String getFieldName(int index); |
| 59 | |
| 60 | /** |
| 61 | * @return the list of subfields (empty array if none) |
| 62 | */ |
| 63 | public ITmfEventField[] getFields(); |
| 64 | |
| 65 | /** |
| 66 | * @return a specific subfield by name (null if absent or inexistent) |
| 67 | */ |
| 68 | public ITmfEventField getField(String name); |
| 69 | |
| 70 | /** |
| 71 | * @return a specific subfield by index (null if absent or inexistent) |
| 72 | */ |
| 73 | public ITmfEventField getField(int index); |
| 74 | |
| 75 | /** |
| 76 | * @return a clone of the event field |
| 77 | */ |
| 78 | public ITmfEventField clone(); |
| 79 | |
| 80 | } |