- Renamed a few classes in accordance with the model
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / event / TmfEvent.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>TmfEvent</u></b>
17 * <p>
18 * The basic event structure in the TMF. In its canonical form, an event has:
19 * <ul>
20 * <li> a normalized timestamp
21 * <li> a source (reporter)
22 * <li> a type
23 * <li> a content
24 * </ul>
25 * For convenience, a free-form reference field is also provided. It could be
26 * used as e.g. a location marker in the event stream to distinguish between
27 * otherwise identical events.
28 */
29 public class TmfEvent extends TmfData {
30
31 // ========================================================================
32 // Attributes
33 // ========================================================================
34
35 private final TmfTimestamp fEffectiveTimestamp;
36 private final TmfTimestamp fOriginalTimestamp;
37 private final TmfEventSource fSource;
38 private final TmfEventType fType;
39 private final TmfEventContent fContent;
40 private final TmfEventReference fReference;
41
42 // ========================================================================
43 // Constructors
44 // ========================================================================
45
46 /**
47 * @param timestamp
48 * @param source
49 * @param type
50 * @param content
51 * @param reference
52 */
53 public TmfEvent(TmfTimestamp originalTS, TmfTimestamp effectiveTS, TmfEventSource source,
54 TmfEventType type, TmfEventContent content, TmfEventReference reference)
55 {
56 fOriginalTimestamp = originalTS;
57 fEffectiveTimestamp = effectiveTS;
58 fSource = source;
59 fType = type;
60 fContent = content;
61 fReference = reference;
62 }
63
64 /**
65 * @param timestamp
66 * @param source
67 * @param type
68 * @param content
69 * @param reference
70 */
71 public TmfEvent(TmfTimestamp timestamp, TmfEventSource source,
72 TmfEventType type, TmfEventContent content, TmfEventReference reference)
73 {
74 fOriginalTimestamp = fEffectiveTimestamp = timestamp;
75 fSource = source;
76 fType = type;
77 fContent = content;
78 fReference = reference;
79 }
80
81 // ========================================================================
82 // Accessors
83 // ========================================================================
84
85 /**
86 * @return
87 */
88 public TmfTimestamp getTimestamp() {
89 return fEffectiveTimestamp;
90 }
91
92 /**
93 * @return
94 */
95 public TmfTimestamp getOriginalTimestamp() {
96 return fOriginalTimestamp;
97 }
98
99 /**
100 * @return
101 */
102 public TmfEventSource getSource() {
103 return fSource;
104 }
105
106 /**
107 * @return
108 */
109 public TmfEventType getType() {
110 return fType;
111 }
112
113 /**
114 * @return
115 */
116 public TmfEventContent getContent() {
117 return fContent;
118 }
119
120 /**
121 * @return
122 */
123 public TmfEventReference getReference() {
124 return fReference;
125 }
126
127 }
This page took 0.033404 seconds and 5 git commands to generate.