tmf: remove deprecated methods from tmf
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / views / callstack / CallStackEntry.java
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made 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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.tmf.ui.views.callstack;
14
15 import java.util.regex.Pattern;
16
17 import org.eclipse.jdt.annotation.NonNull;
18 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
19 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
20 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
21
22 /**
23 * An entry, or row, in the Call Stack view
24 *
25 * @author Patrick Tasse
26 */
27 public class CallStackEntry extends TimeGraphEntry {
28
29 private final int fQuark;
30 private final int fStackLevel;
31 private final int fProcessId;
32 private final ITmfTrace fTrace;
33 private String fFunctionName;
34 private long fFunctionEntryTime;
35 private long fFunctionExitTime;
36 private @NonNull ITmfStateSystem fSS;
37
38 /**
39 * Standard constructor
40 *
41 * @param name
42 * The parent thread name
43 * @param quark
44 * The call stack quark
45 * @param stackLevel
46 * The stack level
47 * @param processId The ID of the process this entry belongs to
48 * @param trace
49 * The trace that this view is talking about
50 * @param ss
51 * The call stack state system
52 * @since 2.0
53 */
54 public CallStackEntry(String name, int quark, int stackLevel, int processId,
55 ITmfTrace trace, @NonNull ITmfStateSystem ss) {
56 super(name, 0, 0);
57 fQuark = quark;
58 fStackLevel = stackLevel;
59 fProcessId = processId;
60 fTrace = trace;
61 fFunctionName = ""; //$NON-NLS-1$
62 fSS = ss;
63 }
64
65 /**
66 * Get the function name of the call stack entry
67 * @return the function name
68 */
69 public String getFunctionName() {
70 return fFunctionName;
71 }
72
73 /**
74 * Set the function name of the call stack entry
75 * @param functionName the function name
76 */
77 public void setFunctionName(String functionName) {
78 fFunctionName = functionName;
79 }
80
81 /**
82 * Set the selected function entry time
83 *
84 * @param entryTime
85 * the function entry time
86 */
87 public void setFunctionEntryTime(long entryTime) {
88 fFunctionEntryTime = entryTime;
89 }
90
91 /**
92 * Get the selected function entry time
93 *
94 * @return the function entry time
95 */
96 public long getFunctionEntryTime() {
97 return fFunctionEntryTime;
98 }
99
100 /**
101 * Set the selected function exit time
102 *
103 * @param exitTime
104 * the function exit time
105 */
106 public void setFunctionExitTime(long exitTime) {
107 fFunctionExitTime = exitTime;
108 }
109
110 /**
111 * Get the selected function exit time
112 *
113 * @return the function exit time
114 */
115 public long getFunctionExitTime() {
116 return fFunctionExitTime;
117 }
118
119 /**
120 * Retrieve the attribute quark that's represented by this entry.
121 *
122 * @return The integer quark
123 */
124 public int getQuark() {
125 return fQuark;
126 }
127
128 /**
129 * Retrieve the stack level associated with this entry.
130 *
131 * @return The stack level or 0
132 */
133 public int getStackLevel() {
134 return fStackLevel;
135 }
136
137 /**
138 * Retrieve the ID of the process this entry belongs to.
139 *
140 * @return The ID of the process
141 * @since 2.0
142 */
143 public int getProcessId() {
144 return fProcessId;
145 }
146
147 /**
148 * Retrieve the trace that is associated to this view.
149 *
150 * @return The trace
151 */
152 public ITmfTrace getTrace() {
153 return fTrace;
154 }
155
156 /**
157 * Retrieve the call stack state system associated with this entry.
158 *
159 * @return The call stack state system
160 */
161 public @NonNull ITmfStateSystem getStateSystem() {
162 return fSS;
163 }
164
165 @Override
166 public boolean matches(@NonNull Pattern pattern) {
167 return pattern.matcher(fFunctionName).find();
168 }
169
170 }
This page took 0.034302 seconds and 5 git commands to generate.