Update for Bug287562 (Event Model code refresh + JUnits)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / event / TmfTraceEvent.java
1 /*******************************************************************************
2 * Copyright (c) 2009 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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.event;
14
15 /**
16 * <b><u>TmfTraceEvent</u></b>
17 * <p>
18 * A trace event associates a source code line to an event. The intent is to
19 * provide the capability to open an editor at the line of code that produced
20 * the event.
21 * <p>
22 * TODO: Concept is still a bit vague and should be aligned with the CDT
23 * source lookup service.
24 */
25 public class TmfTraceEvent extends TmfEvent {
26
27 // ========================================================================
28 // Attributes
29 // ========================================================================
30
31 private final String fSourcePath;
32 private final String fFileName;
33 private final int fLineNumber;
34
35 // ========================================================================
36 // Constructors
37 // ========================================================================
38
39 /**
40 * The constructor.
41 *
42 * @param timestamp
43 * @param source
44 * @param type
45 * @param content
46 * @param reference
47 */
48 public TmfTraceEvent(TmfTimestamp originalTS, TmfTimestamp effectiveTS, TmfEventSource source,
49 TmfEventType type, TmfEventContent content, TmfEventReference reference,
50 String path, String file, int line)
51 {
52 super(originalTS, effectiveTS, source, type,content, reference);
53 fSourcePath = path;
54 fFileName = file;
55 fLineNumber = line;
56 }
57
58 /**
59 * The constructor.
60 *
61 * @param timestamp
62 * @param source
63 * @param type
64 * @param content
65 * @param reference
66 */
67 public TmfTraceEvent(TmfTimestamp timestamp, TmfEventSource source, TmfEventType type,
68 TmfEventContent content, TmfEventReference reference,
69 String path, String file, int line)
70 {
71 super(timestamp, source, type,content, reference);
72 fSourcePath = path;
73 fFileName = file;
74 fLineNumber = line;
75 }
76
77 // ========================================================================
78 // Accessors
79 // ========================================================================
80
81 /**
82 * @return
83 */
84 public String getSourcePath() {
85 return fSourcePath;
86 }
87
88 /**
89 * @return
90 */
91 public String getFileName() {
92 return fFileName;
93 }
94
95 /**
96 * @return
97 */
98 public int getLineNumber() {
99 return fLineNumber;
100 }
101
102 }
This page took 0.034808 seconds and 5 git commands to generate.