5853f3392354d0ed29bb89784e73103065242e53
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / text / TextTraceEvent.java
1 /*******************************************************************************
2 * Copyright (c) 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 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.trace.text;
14
15 import org.eclipse.linuxtools.tmf.core.event.ITmfEventType;
16 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
17 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
18
19 /**
20 * Class to store the common functionality of text trace events.
21 *
22 * @author Alexandre Montplaisir
23 * @since 3.0
24 */
25 public abstract class TextTraceEvent extends TmfEvent {
26
27 /**
28 * Full Constructor.
29 *
30 * Compared to {@link TmfEvent}'s constructor, 'content' is restricted to a
31 * {@link TextTraceEventContent}.
32 *
33 * @param parentTrace
34 * The parent trace
35 * @param timestamp
36 * The event timestamp
37 * @param source
38 * The event source
39 * @param type
40 * The event type
41 * @param content
42 * The event content (payload)
43 * @param reference
44 * The event reference
45 */
46 public TextTraceEvent(TextTrace<? extends TextTraceEvent> parentTrace,
47 final ITmfTimestamp timestamp,
48 final String source,
49 final ITmfEventType type,
50 final TextTraceEventContent content,
51 final String reference) {
52 super(parentTrace, timestamp, source, type, content, reference);
53 }
54
55 /**
56 * Copy constructor
57 *
58 * @param other
59 * The event to copy
60 */
61 public TextTraceEvent(final TextTraceEvent other) {
62 super(other);
63 }
64
65 @Override
66 public TextTrace<? extends TextTraceEvent> getTrace() {
67 /* Cast should be safe, type is restricted by the constructor */
68 return (TextTrace<?>) super.getTrace();
69 }
70
71 @Override
72 public TextTraceEventContent getContent() {
73 /* Cast should be safe, type is restricted by the constructor */
74 return (TextTraceEventContent) super.getContent();
75 }
76 }
This page took 0.036397 seconds and 4 git commands to generate.