btf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / event / scope / EventHeaderScope.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are made
5 * 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 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.ctf.core.event.scope;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19 * A lttng specific speedup node (the packet header with ID and V) of a lexical
20 * scope
21 *
22 * @author Matthew Khouzam
23 * @since 3.1
24 */
25 @NonNullByDefault
26 public class EventHeaderScope extends LexicalScope {
27
28 /**
29 * Event header id string
30 */
31 public static final LexicalScope EVENT_HEADER_ID = new LexicalScope(EVENT_HEADER, "id"); //$NON-NLS-1$
32
33 /**
34 * Event header v as in variant string
35 */
36 public static final LexicalScope EVENT_HEADER_V = new EventHeaderVScope(EVENT_HEADER, "v"); //$NON-NLS-1$
37
38 /**
39 * The scope constructor
40 *
41 * @param parent
42 * The parent node, can be null, but shouldn't
43 * @param name
44 * the name of the field
45 */
46 public EventHeaderScope(LexicalScope parent, String name) {
47 super(parent, name);
48 }
49
50 @Override
51 @Nullable
52 public LexicalScope getChild(String name) {
53 if (name.equals(EVENT_HEADER_ID.getName())) {
54 return EVENT_HEADER_ID;
55 }
56 if (name.equals(EVENT_HEADER_V.getName())) {
57 return EVENT_HEADER_V;
58 }
59 return super.getChild(name);
60 }
61
62 @Override
63 public String toString() {
64 return "event.header"; //$NON-NLS-1$
65 }
66
67 }
This page took 0.03307 seconds and 5 git commands to generate.