1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
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
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.ctf
.core
.event
.scope
;
15 import org
.eclipse
.jdt
.annotation
.NonNullByDefault
;
16 import org
.eclipse
.jdt
.annotation
.Nullable
;
19 * A lttng specific speedup node (the packet header with ID and V) of a lexical
22 * @author Matthew Khouzam
25 public class EventHeaderScope
extends LexicalScope
{
28 * Event header id string
30 public static final LexicalScope EVENT_HEADER_ID
= new LexicalScope(EVENT_HEADER
, "id"); //$NON-NLS-1$
33 * Event header v as in variant string
35 public static final LexicalScope EVENT_HEADER_V
= new EventHeaderVScope(EVENT_HEADER
, "v"); //$NON-NLS-1$
38 * The scope constructor
41 * The parent node, can be null, but shouldn't
43 * the name of the field
45 public EventHeaderScope(LexicalScope parent
, String name
) {
51 public LexicalScope
getChild(String name
) {
52 if (name
.equals(EVENT_HEADER_ID
.getName())) {
53 return EVENT_HEADER_ID
;
55 if (name
.equals(EVENT_HEADER_V
.getName())) {
56 return EVENT_HEADER_V
;
58 return super.getChild(name
);
62 public String
toString() {
63 return "event.header"; //$NON-NLS-1$