| 1 | package dmg.cells.nucleus ; |
| 2 | /** |
| 3 | * The message event is the vehicle which is used |
| 4 | * to deliver a message to a cell. |
| 5 | |
| 6 | * |
| 7 | * |
| 8 | * @author Patrick Fuhrmann |
| 9 | * @version 0.1, 15 Feb 1998 |
| 10 | |
| 11 | */ |
| 12 | public class MessageEvent extends CellEvent { |
| 13 | /** |
| 14 | * The MessageEvent constructor creates a MessageEvent |
| 15 | * containing the specified CellMessage. |
| 16 | */ |
| 17 | public MessageEvent( CellMessage msg ){ |
| 18 | super( msg , CellEvent.OTHER_EVENT ) ; |
| 19 | return ; |
| 20 | } |
| 21 | /** |
| 22 | * getMessage extracts the CellMessage out of the |
| 23 | * MessageEvent. |
| 24 | */ |
| 25 | public CellMessage getMessage(){ |
| 26 | return (CellMessage) getSource() ; |
| 27 | } |
| 28 | public String toString(){ |
| 29 | return "MessageEvent(source="+getSource().toString()+")" ; |
| 30 | } |
| 31 | } |