/
InstrumentedGroupDescriptor.java
79 lines (70 loc) · 2.63 KB
/
InstrumentedGroupDescriptor.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*******************************************************************************
* Copyright (c) 2016 École Polytechnique de Montréal
*
* 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.analysis.callstack.core.instrumented;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
/**
* These group descriptors describe each group of a callstack hierarchy with
* patterns in the state system.
*
* @author Geneviève Bastien
*/
public class InstrumentedGroupDescriptor extends CallStackGroupDescriptor {
private final String[] fSubPattern;
private final ITmfStateSystem fSs;
/**
* Constructor
*
* @param ss
* The state system containing the callstack
* @param subPath
* The sub-path to this group
* @param nextGroup
* The next group of the hierarchy, i.e., the child of the group
* being constructed or <code>null</code> if this group is the
* leaf
* @param isSymbolKeyGroup
* Whether this level contains the symbol key
*/
public InstrumentedGroupDescriptor(ITmfStateSystem ss, String[] subPath, @Nullable InstrumentedGroupDescriptor nextGroup, boolean isSymbolKeyGroup) {
super(String.valueOf(StringUtils.join(subPath, '/')), nextGroup, isSymbolKeyGroup);
fSubPattern = subPath;
fSs = ss;
}
/**
* Get the pattern in the state system corresponding to this level. From the
* quark of the parent, the elements corresponding to this sub-pattern will
* be the elements of this group.
*
* @return The pattern of the elements at this level
*/
public String[] getSubPattern() {
return fSubPattern;
}
/**
* Get the state system where this group belongs
*
* @return The state system
*/
public ITmfStateSystem getStateSystem() {
return fSs;
}
@Override
public @Nullable InstrumentedGroupDescriptor getNextGroup() {
return (InstrumentedGroupDescriptor) super.getNextGroup();
}
@Override
public @NonNull String getName() {
return String.valueOf(StringUtils.join(fSubPattern, '/'));
}
}