 |
|
|
Host.java
|
import java.util.Collection;
/**
* A Host which might be infected by a Virus.
* Current methods are tailered for the infection,
* a future definition might include functions for
* vacination etc.
*
* @author Havard Rast Blok
*
*/
public interface Host {
/**
* Returns true if this Host is infected with on or more Viruses.
* @return true if this Host is infected with on or more Viruses.
*/
public boolean isInfected();
/**
* Infects this Host with the specified Virus.
* @param virus the Virus to infect this Host.
*/
public void addVirus(Virus virus);
/**
* Returns all the Viruses which have infected this Host,
* or an empty Collection if it is not infected.
*
* The order of the Viruses is not guarantied.
*
* @return the Viruses which have infected this Host.
*/
public Collection<Virus> getViruses();
/**
* Returns the probability of transmitting any Virus from
* the specified transmitter Host this host.
* @param transmitter the infected Host.
* @return the probability of Virus tranmition between the
* specifed and this Host.
*/
public double transmitProbability(Host transmitter);
}
|
|
|
 |