analysis: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / 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.tracecompass.tmf.core.trace.text;
14
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.eclipse.tracecompass.tmf.core.event.ITmfEventType;
17 import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
18 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
19 import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
20
21 /**
22 * Class to store the common functionality of text trace events.
23 *
24 * @author Alexandre Montplaisir
25 */
26 public abstract class TextTraceEvent extends TmfEvent {
27
28 /**
29 * Full Constructor.
30 *
31 * Compared to {@link TmfEvent}'s constructor, 'content' is restricted to a
32 * {@link TextTraceEventContent}.
33 *
34 * @param parentTrace
35 * The parent trace
36 * @param timestamp
37 * The event timestamp
38 * @param type
39 * The event type
40 * @param content
41 * The event content (payload)
42 */
43 public TextTraceEvent(TextTrace<? extends TextTraceEvent> parentTrace,
44 final ITmfTimestamp timestamp,
45 final ITmfEventType type,
46 final TextTraceEventContent content) {
47 super(parentTrace, ITmfContext.UNKNOWN_RANK, timestamp, type, content);
48 }
49
50 /**
51 * Copy constructor
52 *
53 * @param other
54 * The event to copy
55 */
56 public TextTraceEvent(final @NonNull TextTraceEvent other) {
57 super(other);
58 }
59
60 @Override
61 public TextTrace<? extends TextTraceEvent> getTrace() {
62 /* Cast should be safe, type is restricted by the constructor */
63 return (TextTrace<?>) super.getTrace();
64 }
65
66 @Override
67 public TextTraceEventContent getContent() {
68 /* Cast should be safe, type is restricted by the constructor */
69 return (TextTraceEventContent) super.getContent();
70 }
71 }
This page took 0.043759 seconds and 5 git commands to generate.