-
Notifications
You must be signed in to change notification settings - Fork 10
/
ClockMapParser.java
42 lines (34 loc) · 1.35 KB
/
ClockMapParser.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*******************************************************************************
* Copyright (c) 2015, 2023 Ericsson
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tracecompass.internal.ctf.core.event.metadata.tsdl.integer;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.internal.ctf.core.event.metadata.ICommonTreeParser;
import org.eclipse.tracecompass.internal.ctf.core.event.types.ICTFMetadataNode;
/**
* A reference to the clock map in a given integer.
*
* @author Matthew Khouzam
*
*/
public final class ClockMapParser implements ICommonTreeParser {
private static final @NonNull String EMPTY_STRING = ""; //$NON-NLS-1$
/**
* Instance
*/
public static final ClockMapParser INSTANCE = new ClockMapParser();
private ClockMapParser() {
}
@Override
public String parse(ICTFMetadataNode tree, ICommonTreeParserParameter param) {
String clock = tree.getChild(1).getChild(0).getChild(0).getText();
return clock == null ? EMPTY_STRING : clock;
}
}