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
.linuxtools
.ctf
.core
.event
.scope
;
15 import org
.eclipse
.jdt
.annotation
.NonNullByDefault
;
16 import org
.eclipse
.jdt
.annotation
.Nullable
;
19 * A lttng specific speedup node (v variant for event headers) of a lexical
20 * scope they normally contain a timestamp
22 * @author Matthew Khouzam
26 public class EventHeaderVScope
extends LexicalScope
{
29 * Packet header v id string
31 public static final LexicalScope PACKET_HEADER_V_ID
= new LexicalScope(PACKET_HEADER
, "id"); //$NON-NLS-1$
33 * Packet header v timestamp string
35 public static final LexicalScope PACKET_HEADER_V_TIMESTAMP
= new LexicalScope(PACKET_HEADER
, "timestamp"); //$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 EventHeaderVScope(LexicalScope parent
, String name
) {
51 public LexicalScope
getChild(String name
) {
52 if (name
.equals(PACKET_HEADER_V_TIMESTAMP
.getName())) {
53 return PACKET_HEADER_V_TIMESTAMP
;
55 if (name
.equals(PACKET_HEADER_V_ID
.getName())) {
56 return PACKET_HEADER_V_ID
;
58 return super.getChild(name
);