tmf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / linuxtools / tmf / core / uml2sd / TmfSyncSequenceDiagramEvent.java
1 /**********************************************************************
2 * Copyright (c) 2011, 2013 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 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org.eclipse.linuxtools.tmf.core.uml2sd;
13
14 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
15 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
16
17 /**
18 * <p>
19 * A basic implementation of ITmfSyncSequenceDiagramEvent.
20 * </p>
21 *
22 * @version 1.0
23 * @author Bernd Hufmann
24 */
25 public class TmfSyncSequenceDiagramEvent implements ITmfSyncSequenceDiagramEvent {
26
27 // ------------------------------------------------------------------------
28 // Attributes
29 // ------------------------------------------------------------------------
30 /**
31 * The start time of the sequence diagram event (i.e. time when signal was sent).
32 */
33 private final ITmfTimestamp fStartTime;
34 /**
35 * The name of the sender of the signal.
36 */
37 private final String fSender;
38 /**
39 * The name of the receiver of the signal.
40 */
41 private final String fReceiver;
42 /**
43 * The name of the signal
44 */
45 private final String fName;
46
47 // ------------------------------------------------------------------------
48 // Constructors
49 // ------------------------------------------------------------------------
50 /**
51 * Constructor
52 *
53 * @param startEvent The start event (on sender side).
54 * @param sender The name of sender of signal.
55 * @param receiver The Name of receiver of signal.
56 * @param name - The signal name
57 */
58 public TmfSyncSequenceDiagramEvent(ITmfEvent startEvent, String sender, String receiver, String name) {
59
60 if ((startEvent == null) || (sender == null) || (receiver == null) || (name == null)) {
61 throw new IllegalArgumentException("TmfSyncSequenceDiagramEvent constructor: " + //$NON-NLS-1$
62 (startEvent == null ? ", startEvent=null" : "") + //$NON-NLS-1$ //$NON-NLS-2$
63 (sender == null ? ", sender=null" : "") + //$NON-NLS-1$ //$NON-NLS-2$
64 (receiver == null ? ", receiver=null" : "") + //$NON-NLS-1$ //$NON-NLS-2$
65 (name == null ? ", name=null" : "")); //$NON-NLS-1$ //$NON-NLS-2$
66 }
67
68 fStartTime = startEvent.getTimestamp();
69
70 fSender = sender;
71 fReceiver = receiver;
72
73 fName = name;
74 }
75
76 // ------------------------------------------------------------------------
77 // Operations
78 // ------------------------------------------------------------------------
79
80 @Override
81 public String getSender() {
82 return fSender;
83 }
84
85 @Override
86 public String getReceiver() {
87 return fReceiver;
88 }
89
90 @Override
91 public String getName() {
92 return fName;
93 }
94
95 /**
96 * @since 2.0
97 */
98 @Override
99 public ITmfTimestamp getStartTime() {
100 return fStartTime;
101 }
102 }
This page took 0.041394 seconds and 5 git commands to generate.