|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.person.medical.Medication
public abstract class Medication
An abstract class representing a medication a person has taken.
| Constructor Summary | |
|---|---|
Medication(String name,
double duration,
Person person)
Constructor. |
|
| Method Summary | |
|---|---|
int |
compareTo(Medication o)
Compares this object with the specified object for order. |
boolean |
equals(Object object)
|
double |
getDuration()
Gets the time duration of the medication. |
String |
getName()
Gets the name of the medication. |
Person |
getPerson()
Gets the person taking the medication. |
double |
getTimeElapsed()
Gets the time elapsed since medication was taken. |
int |
hashCode()
|
boolean |
isMedicated()
Is the person under the influence of this medication? |
void |
timePassing(double time)
Update the medication based on passing time. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Medication(String name,
double duration,
Person person)
name - the name of the medication.duration - the time duration (millisols).person - the person to be medicated.| Method Detail |
|---|
public String getName()
public double getDuration()
public Person getPerson()
public double getTimeElapsed()
public void timePassing(double time)
time - amount of time (millisols).public boolean isMedicated()
public boolean equals(Object object)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int compareTo(Medication o)
compareTo in interface Comparable<Medication>o - the Object to be compared.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||