org.mars_sim.msp.simulation.person.medical
Class Treatment

java.lang.Object
  extended by org.mars_sim.msp.simulation.person.medical.Treatment
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Treatment>

public class Treatment
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<Treatment>

This class represents a Medical treatment that can be applied to a Person to cure a complaint.

See Also:
Serialized Form

Constructor Summary
Treatment(java.lang.String name, int skill, double duration, boolean selfAdmin, boolean retainAid, int facilityLevel)
          Create a Treatment.
 
Method Summary
 int compareTo(Treatment otherTreatment)
          Compare this object with another
 boolean equals(java.lang.Object other)
          Check this object with another object.
 double getAdjustedDuration(int skill)
          Get the time required to perform this treatment by a Person with the appropriate skill rating.
 double getDuration()
          Return the theoritical duration of this treatment.
 int getFacilityLevel()
          Get the required facility level
 java.lang.String getName()
          Return the name of the treatment
 boolean getRetainAid()
          Does this Treatment require the sufferer to continue to use any MedicalAids.
 boolean getSelfAdminister()
          Can the treatment be self administered.
 int getSkill()
          Return the Medical skill requried for this treatment
 int hashCode()
          Hash code vlaue for this object.
 java.lang.String toString()
          Return string representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Treatment

public Treatment(java.lang.String name,
                 int skill,
                 double duration,
                 boolean selfAdmin,
                 boolean retainAid,
                 int facilityLevel)
Create a Treatment.

Parameters:
name - The unique name.
skill - Required Medical skill.
duration - The duration of treatment in millisols.
retainAid - Does the recovery after treatment require the medical aid
Method Detail

compareTo

public int compareTo(Treatment otherTreatment)
Compare this object with another

Specified by:
compareTo in interface java.lang.Comparable<Treatment>

equals

public boolean equals(java.lang.Object other)
Check this object with another object.

Overrides:
equals in class java.lang.Object
Parameters:
other - Object to compare.
Returns:
DO they match.

getAdjustedDuration

public double getAdjustedDuration(int skill)
Get the time required to perform this treatment by a Person with the appropriate skill rating.

Parameters:
skill - The skill rating that will apply the treatment.
Returns:
Adjusted treatment time according to skill.

getDuration

public double getDuration()
Return the theoritical duration of this treatment.

Returns:
The duration to apply this Treatment.

getFacilityLevel

public int getFacilityLevel()
Get the required facility level


getName

public java.lang.String getName()
Return the name of the treatment


getRetainAid

public boolean getRetainAid()
Does this Treatment require the sufferer to continue to use any MedicalAids.

Returns:
boolean flag.

getSkill

public int getSkill()
Return the Medical skill requried for this treatment


getSelfAdminister

public boolean getSelfAdminister()
Can the treatment be self administered.


hashCode

public int hashCode()
Hash code vlaue for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code.

toString

public java.lang.String toString()
Return string representation.

Overrides:
toString in class java.lang.Object
Returns:
The treatment name.