| 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 ITmfAsyncSequenceDiagramEvent. |
| 20 | * </p> |
| 21 | * |
| 22 | * @version 1.0 |
| 23 | * @author Bernd Hufmann |
| 24 | */ |
| 25 | public class TmfAsyncSequenceDiagramEvent extends TmfSyncSequenceDiagramEvent implements ITmfAsyncSequenceDiagramEvent { |
| 26 | |
| 27 | // ------------------------------------------------------------------------ |
| 28 | // Attributes |
| 29 | // ------------------------------------------------------------------------ |
| 30 | /** |
| 31 | * The end time of the sequence diagram event (i.e. time when signal was received). |
| 32 | */ |
| 33 | private final ITmfTimestamp fEndTime; |
| 34 | |
| 35 | // ------------------------------------------------------------------------ |
| 36 | // Constructors |
| 37 | // ------------------------------------------------------------------------ |
| 38 | /** |
| 39 | * Constructor |
| 40 | * |
| 41 | * @param startEvent The start event (on sender side). |
| 42 | * @param endEvent The end event (receiver side). |
| 43 | * @param sender The name of sender of signal. |
| 44 | * @param receiver The Name of receiver of signal. |
| 45 | * @param name - The signal name |
| 46 | */ |
| 47 | public TmfAsyncSequenceDiagramEvent(ITmfEvent startEvent, ITmfEvent endEvent, String sender, String receiver, String name) { |
| 48 | super(startEvent, sender, receiver, name); |
| 49 | |
| 50 | if (endEvent == null) { |
| 51 | throw new IllegalArgumentException("TmfAsyncSequenceDiagramEvent constructor: endEvent=null"); //$NON-NLS-1$ |
| 52 | } |
| 53 | fEndTime = endEvent.getTimestamp(); |
| 54 | } |
| 55 | |
| 56 | // ------------------------------------------------------------------------ |
| 57 | // Operations |
| 58 | // ------------------------------------------------------------------------ |
| 59 | |
| 60 | /** |
| 61 | * @since 2.0 |
| 62 | */ |
| 63 | @Override |
| 64 | public ITmfTimestamp getEndTime() { |
| 65 | return fEndTime; |
| 66 | } |
| 67 | } |