cz.muni.fi.pb162.task2
Class AbstractMessaging

java.lang.Object
  extended by cz.muni.fi.pb162.task2.AbstractMessaging
All Implemented Interfaces:
Messaging
Direct Known Subclasses:
Mail, Pigeon

public abstract class AbstractMessaging
extends Object
implements Messaging

Class abstracts the common functionality of the lower classes (abstract medium for the transmission of messages)

Version:
06 11 2009
Author:
Tomas Sedmik, xsedmik@fi.muni.cz

Constructor Summary
AbstractMessaging()
           
 
Method Summary
abstract  double deliveryTime()
          Calculates approximate delivery time.
 Message getMessage()
           
 void send()
          Simulates message delivery.
 void setMessage(Message msg)
          Sets the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMessaging

public AbstractMessaging()
Method Detail

deliveryTime

public abstract double deliveryTime()
Calculates approximate delivery time.

Specified by:
deliveryTime in interface Messaging
Returns:
approximate delivery time in hours

getMessage

public Message getMessage()
Specified by:
getMessage in interface Messaging
Returns:
delivered message

send

public void send()
Simulates message delivery. This method will just write the following text into the std. output: "Message to will arrive in hours." where is message addressee and is delivery time.

Specified by:
send in interface Messaging

setMessage

public void setMessage(Message msg)
Sets the message.

Specified by:
setMessage in interface Messaging
Parameters:
msg - Message for delivery