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