868c58a5c57f8fbe097b1540e3c2781424231555
[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 org.eclipse.jdt.annotation.NonNull;
16 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
17 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
18 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
19
20 /**
21 * An entry, or row, in the Call Stack view
22 *
23 * @author Patrick Tasse
24 */
25 public class CallStackEntry extends TimeGraphEntry {
26
27 private final int fQuark;
28 private final int fStackLevel;
29 private final ITmfTrace fTrace;
30 private String fFunctionName;
31 private long fFunctionEntryTime;
32 private long fFunctionExitTime;
33 private @NonNull ITmfStateSystem fSS;
34
35 /**
36 * Standard constructor
37 *
38 * @param quark
39 * The call stack quark
40 * @param stackLevel
41 * The stack level
42 * @param trace
43 * The trace that this view is talking about
44 * @deprecated Use {@link #CallStackEntry(String, int, int, ITmfTrace, ITmfStateSystem)}
45 */
46 @Deprecated
47 public CallStackEntry(int quark, int stackLevel, ITmfTrace trace) {
48 super(null, 0, 0);
49 throw new UnsupportedOperationException();
50 }
51
52 /**
53 * Standard constructor
54 *
55 * @param name
56 * The parent thread name
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
65 */
66 public CallStackEntry(String name, int quark, int stackLevel, ITmfTrace trace, @NonNull ITmfStateSystem ss) {
67 super(name, 0, 0);
68 fQuark = quark;
69 fStackLevel = stackLevel;
70 fTrace = trace;
71 fFunctionName = ""; //$NON-NLS-1$
72 fSS = ss;
73 }
74
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
91 /**
92 * Set the start time of the call stack entry
93 * @param startTime the start time
94 * @deprecated Use {@link #setFunctionEntryTime(long)}
95 */
96 @Deprecated
97 public void setStartTime(long startTime) {
98 throw new UnsupportedOperationException();
99 }
100
101 /**
102 * Set the end time of the call stack entry
103 * @param endTime the end time
104 * @deprecated Use {@link #setFunctionExitTime(long)}
105 */
106 @Deprecated
107 public void setEndTime(long endTime) {
108 throw new UnsupportedOperationException();
109 }
110
111 /**
112 * Set the selected function entry time
113 *
114 * @param entryTime
115 * the function entry time
116 */
117 public void setFunctionEntryTime(long entryTime) {
118 fFunctionEntryTime = entryTime;
119 }
120
121 /**
122 * Get the selected function entry time
123 *
124 * @return the function entry time
125 */
126 public long getFunctionEntryTime() {
127 return fFunctionEntryTime;
128 }
129
130 /**
131 * Set the selected function exit time
132 *
133 * @param exitTime
134 * the function exit time
135 */
136 public void setFunctionExitTime(long exitTime) {
137 fFunctionExitTime = exitTime;
138 }
139
140 /**
141 * Get the selected function exit time
142 *
143 * @return the function exit time
144 */
145 public long getFunctionExitTime() {
146 return fFunctionExitTime;
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
176 /**
177 * Retrieve the call stack state system associated with this entry.
178 *
179 * @return The call stack state system
180 */
181 public @NonNull ITmfStateSystem getStateSystem() {
182 return fSS;
183 }
184
185 }
This page took 0.045536 seconds and 4 git commands to generate.