Commit | Line | Data |
---|---|---|
73005152 BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2011 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 | **********************************************************************/ | |
6c13869b | 12 | package org.eclipse.linuxtools.tmf.core.uml2sd; |
73005152 | 13 | |
4df4581d | 14 | import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp; |
6c13869b | 15 | import org.eclipse.linuxtools.tmf.core.event.TmfEvent; |
73005152 BH |
16 | |
17 | /** | |
18 | * <b><u>TmfSyncSequenceDiagramEvent</u></b> | |
19 | * <p> | |
20 | * Sample implementation of the ITmfSyncSequenceDiagramEvent | |
21 | * </p> | |
22 | */ | |
23 | public class TmfSyncSequenceDiagramEvent implements ITmfSyncSequenceDiagramEvent { | |
24 | ||
25 | // ------------------------------------------------------------------------ | |
26 | // Attributes | |
27 | // ------------------------------------------------------------------------ | |
4df4581d | 28 | final protected ITmfTimestamp fStartTime; |
73005152 BH |
29 | final protected String fSender; |
30 | final protected String fReceiver; | |
31 | final protected String fName; | |
32 | ||
33 | // ------------------------------------------------------------------------ | |
34 | // Constructors | |
35 | // ------------------------------------------------------------------------ | |
36 | public TmfSyncSequenceDiagramEvent(TmfEvent startEvent, String sender, String receiver, String name) { | |
37 | ||
38 | if (startEvent == null || sender == null || receiver == null || name == null) { | |
39 | throw new IllegalArgumentException("TmfSyncSequenceDiagramEvent constructor: " + //$NON-NLS-1$ | |
40 | (startEvent == null ? ", startEvent=null" : "") + //$NON-NLS-1$ //$NON-NLS-2$ | |
41 | (sender == null ? ", sender=null" : "") + //$NON-NLS-1$ //$NON-NLS-2$ | |
42 | (receiver == null ? ", receiver=null" : "") + //$NON-NLS-1$ //$NON-NLS-2$ | |
43 | (name == null ? ", name=null" : "")); //$NON-NLS-1$ //$NON-NLS-2$ | |
44 | } | |
45 | ||
46 | fStartTime = startEvent.getTimestamp().clone(); | |
47 | ||
48 | fSender = sender; | |
49 | fReceiver = receiver; | |
50 | ||
51 | fName = name; | |
52 | } | |
53 | ||
54 | // ------------------------------------------------------------------------ | |
55 | // Operations | |
56 | // ------------------------------------------------------------------------ | |
57 | /* | |
58 | * (non-Javadoc) | |
59 | * @see org.eclipse.linuxtools.tmf.uml2sd.ITmfSyncSequenceDiagramEvent#getSender() | |
60 | */ | |
61 | @Override | |
62 | public String getSender() { | |
63 | return fSender; | |
64 | } | |
65 | ||
66 | /* | |
67 | * (non-Javadoc) | |
68 | * @see org.eclipse.linuxtools.tmf.uml2sd.ITmfSyncSequenceDiagramEvent#getReceiver() | |
69 | */ | |
70 | @Override | |
71 | public String getReceiver() { | |
72 | return fReceiver; | |
73 | } | |
74 | ||
75 | /* | |
76 | * (non-Javadoc) | |
77 | * @see org.eclipse.linuxtools.tmf.uml2sd.ITmfSyncSequenceDiagramEvent#getName() | |
78 | */ | |
79 | @Override | |
80 | public String getName() { | |
81 | return fName; | |
82 | } | |
83 | ||
84 | /* | |
85 | * (non-Javadoc) | |
86 | * @see org.eclipse.linuxtools.tmf.uml2sd.ITmfSyncSequenceDiagramEvent#getStartTime() | |
87 | */ | |
88 | @Override | |
4df4581d | 89 | public ITmfTimestamp getStartTime() { |
73005152 BH |
90 | return fStartTime; |
91 | } | |
92 | } |