Commit | Line | Data |
---|---|---|
f47ed727 | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2013, 2014 Ericsson |
f47ed727 BH |
3 | * |
4 | * All rights reserved. This program and the accompanying materials are made | |
5 | * 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 | * Bernd Hufmann - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.core.event.lookup; |
f47ed727 | 14 | |
8936d4f2 | 15 | import org.eclipse.jdt.annotation.NonNull; |
3335f36e | 16 | import org.eclipse.jdt.annotation.Nullable; |
f47ed727 BH |
17 | |
18 | /** | |
19 | * The generic call site structure in TMF. A call site has: | |
20 | * <ul> | |
21 | * <li> a file name | |
22 | * <li> a function name (optional) | |
23 | * <li> a line number | |
24 | * </ul> | |
25 | * | |
26 | * @author Bernd Hufmann | |
f47ed727 BH |
27 | * |
28 | * @see TmfCallsite | |
29 | */ | |
30 | public interface ITmfCallsite { | |
04ca66e5 | 31 | |
f47ed727 BH |
32 | /** |
33 | * Returns the file name of the call site. | |
04ca66e5 | 34 | * |
f47ed727 BH |
35 | * @return the file name |
36 | */ | |
8936d4f2 | 37 | @NonNull String getFileName(); |
f47ed727 BH |
38 | |
39 | /** | |
40 | * Returns the function name of the call site. | |
04ca66e5 | 41 | * |
f47ed727 | 42 | * @return the function name or null |
0c65e461 | 43 | * @deprecated Should not be part of this interface anymore. |
f47ed727 | 44 | */ |
0c65e461 | 45 | @Deprecated |
3335f36e | 46 | @Nullable String getFunctionName(); |
f47ed727 BH |
47 | |
48 | /** | |
49 | * Returns the line number of the call site. | |
04ca66e5 | 50 | * |
f47ed727 | 51 | * @return the line number |
0c65e461 | 52 | * @deprecated Use {@link #getLineNo()} instead, which can return null. |
f47ed727 | 53 | */ |
0c65e461 | 54 | @Deprecated |
04ca66e5 | 55 | long getLineNumber(); |
0c65e461 AM |
56 | |
57 | /** | |
58 | * Returns the line number of the call site. | |
59 | * | |
60 | * @return The line number, or 'null' if unavailable | |
61 | * @since 2.1 | |
62 | */ | |
63 | default @Nullable Long getLineNo() { | |
64 | /* TODO Change to abstract method once getLineNumber() is removed */ | |
65 | return getLineNumber(); | |
66 | } | |
f47ed727 | 67 | } |