analysis: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / views / callstack / CallStackEntry.java
CommitLineData
e8251298 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2013, 2014 Ericsson
e8251298
PT
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
2bdf0193 13package org.eclipse.tracecompass.tmf.ui.views.callstack;
e8251298 14
da27e43a 15import org.eclipse.jdt.annotation.NonNull;
e894a508 16import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
2bdf0193
AM
17import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
18import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
e8251298
PT
19
20/**
21 * An entry, or row, in the Call Stack view
22 *
23 * @author Patrick Tasse
e8251298 24 */
60b4d44c 25public class CallStackEntry extends TimeGraphEntry {
e8251298
PT
26
27 private final int fQuark;
28 private final int fStackLevel;
29 private final ITmfTrace fTrace;
e8251298 30 private String fFunctionName;
60b4d44c
PT
31 private long fFunctionEntryTime;
32 private long fFunctionExitTime;
da27e43a 33 private @NonNull ITmfStateSystem fSS;
e8251298
PT
34
35 /**
36 * Standard constructor
37 *
38 * @param quark
da27e43a 39 * The call stack quark
e8251298
PT
40 * @param stackLevel
41 * The stack level
42 * @param trace
43 * The trace that this view is talking about
e28e05f6 44 * @deprecated Use {@link #CallStackEntry(String, int, int, ITmfTrace, ITmfStateSystem)}
e8251298 45 */
da27e43a 46 @Deprecated
e8251298 47 public CallStackEntry(int quark, int stackLevel, ITmfTrace trace) {
60b4d44c 48 super(null, 0, 0);
da27e43a
PT
49 throw new UnsupportedOperationException();
50 }
51
52 /**
53 * Standard constructor
54 *
60b4d44c
PT
55 * @param name
56 * The parent thread name
da27e43a
PT
57 * @param quark
58 * The call stack quark
59 * @param stackLevel
60 * The stack level
61 * @param trace
62 * The trace that this view is talking about
63 * @param ss
64 * The call stack state system
da27e43a 65 */
60b4d44c
PT
66 public CallStackEntry(String name, int quark, int stackLevel, ITmfTrace trace, @NonNull ITmfStateSystem ss) {
67 super(name, 0, 0);
e8251298
PT
68 fQuark = quark;
69 fStackLevel = stackLevel;
70 fTrace = trace;
71 fFunctionName = ""; //$NON-NLS-1$
da27e43a 72 fSS = ss;
e8251298
PT
73 }
74
e8251298
PT
75 /**
76 * Get the function name of the call stack entry
77 * @return the function name
78 */
79 public String getFunctionName() {
80 return fFunctionName;
81 }
82
83 /**
84 * Set the function name of the call stack entry
85 * @param functionName the function name
86 */
87 public void setFunctionName(String functionName) {
88 fFunctionName = functionName;
89 }
90
e8251298
PT
91 /**
92 * Set the start time of the call stack entry
93 * @param startTime the start time
60b4d44c 94 * @deprecated Use {@link #setFunctionEntryTime(long)}
e8251298 95 */
60b4d44c 96 @Deprecated
e8251298 97 public void setStartTime(long startTime) {
60b4d44c 98 throw new UnsupportedOperationException();
e8251298
PT
99 }
100
101 /**
102 * Set the end time of the call stack entry
103 * @param endTime the end time
60b4d44c 104 * @deprecated Use {@link #setFunctionExitTime(long)}
e8251298 105 */
60b4d44c 106 @Deprecated
e8251298 107 public void setEndTime(long endTime) {
60b4d44c 108 throw new UnsupportedOperationException();
e8251298
PT
109 }
110
60b4d44c
PT
111 /**
112 * Set the selected function entry time
113 *
114 * @param entryTime
115 * the function entry time
60b4d44c
PT
116 */
117 public void setFunctionEntryTime(long entryTime) {
118 fFunctionEntryTime = entryTime;
e8251298
PT
119 }
120
60b4d44c
PT
121 /**
122 * Get the selected function entry time
123 *
124 * @return the function entry time
60b4d44c
PT
125 */
126 public long getFunctionEntryTime() {
127 return fFunctionEntryTime;
e8251298
PT
128 }
129
60b4d44c
PT
130 /**
131 * Set the selected function exit time
132 *
133 * @param exitTime
134 * the function exit time
60b4d44c
PT
135 */
136 public void setFunctionExitTime(long exitTime) {
137 fFunctionExitTime = exitTime;
e8251298
PT
138 }
139
140 /**
60b4d44c 141 * Get the selected function exit time
e8251298 142 *
60b4d44c 143 * @return the function exit time
e8251298 144 */
60b4d44c
PT
145 public long getFunctionExitTime() {
146 return fFunctionExitTime;
e8251298
PT
147 }
148
149 /**
150 * Retrieve the attribute quark that's represented by this entry.
151 *
152 * @return The integer quark
153 */
154 public int getQuark() {
155 return fQuark;
156 }
157
158 /**
159 * Retrieve the stack level associated with this entry.
160 *
161 * @return The stack level or 0
162 */
163 public int getStackLevel() {
164 return fStackLevel;
165 }
166
167 /**
168 * Retrieve the trace that is associated to this view.
169 *
170 * @return The trace
171 */
172 public ITmfTrace getTrace() {
173 return fTrace;
174 }
175
da27e43a
PT
176 /**
177 * Retrieve the call stack state system associated with this entry.
178 *
179 * @return The call stack state system
da27e43a
PT
180 */
181 public @NonNull ITmfStateSystem getStateSystem() {
182 return fSS;
183 }
184
e8251298 185}
This page took 0.10595 seconds and 5 git commands to generate.