📄 patientuos.java
字号:
package hospital_sys;
/** Encapsulate information about a patient */
public class PatientUos implements java.io.Serializable
{
/* Fields to store the patient information. */
String name;
int bedNum;
String docName;
String drugName;
int hospNum;
/** Make a patient from data passed in as arguments
Analysis: Time = O(1) */
public PatientUos(String newName, int bedNumber, String doctorName, String drug, int hospNumber)
{
name = newName;
bedNum = bedNumber;
docName = doctorName;
drugName = drug;
hospNum = hospNumber;
}
/** Return the name of the patient
Analysis: Time = O(1) */
public String name()
{
return name;
}
/** Return the bed number of the patient
Analysis: Time = O(1) */
public int bedNum()
{
return bedNum;
}
/** Return the doctor's name
Analysis: Time = O(1) */
public String docName()
{
return docName;
}
/** Return the drug's name
Analysis: Time = O(1) */
public String drugName()
{
return drugName;
}
/** Return the hospitilization number
Analysis: Time = O(1) */
public int hospNum()
{
return hospNum;
}
/** String representation of the patient
Analysis: Time = O(1) */
public String toString()
{
String result = "";
result += "\nHospitilization number: " + hospNum + "\nName : " + name + "\nBed : " + bedNum
+ "\nDoctor's name : " + docName + "\nDrug : " + drugName;
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -