Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. package com.AllergyDemo;
  2.  
  3. public class Person {
  4. private String name;
  5. private int phone;
  6. private String address;
  7. private int age;
  8.  
  9.  
  10. public Person(String name, int phone, String address, int age) {
  11. super();
  12. this.name = name;
  13. this.phone = phone;
  14. this.address = address;
  15. this.age = age;
  16. }
  17.  
  18. public String getName() {
  19. return name;
  20. }
  21.  
  22. public void setName(String name) {
  23. this.name = name;
  24. }
  25.  
  26.  
  27. public int getPhone() {
  28. return phone;
  29. }
  30.  
  31. public void setPhone(int phone) {
  32. this.phone = phone;
  33. }
  34.  
  35.  
  36. public String getAddress() {
  37. return address;
  38. }
  39.  
  40. public void setAddress(String address) {
  41. this.address = address;
  42. }
  43.  
  44.  
  45. public int getAge() {
  46. return age;
  47. }
  48.  
  49. public void setAge(int age) {
  50. this.age = age;
  51. }
  52.  
  53.  
  54. public String toString() {
  55. return " Name: " + name + ", Age: " + age + ", Address: " + address + ", Phone: " +phone;
  56. }
  57.  
  58.  
  59.  
  60. }
  61.  
  62. package com.AllergyDemo;
  63.  
  64. public class Allergy_2 {
  65.  
  66.  
  67. private String allname;
  68. private String severity;
  69.  
  70. public Allergy_2(String allname, String severity) {
  71. super();
  72. this.allname = allname;
  73. this.severity = severity;
  74. }
  75. public String getAllname() {
  76. return allname;
  77. }
  78. public void setAllname(String allname) {
  79. this.allname = allname;
  80. }
  81. public String getSeverity() {
  82. return severity;
  83. }
  84. public void setSeverity(String severity) {
  85. this.severity = severity;
  86. }
  87. public String toString() {
  88. return " Name: " + allname + ", Severity: " + severity;
  89. }
  90.  
  91. }
  92.  
  93. package com.AllergyDemo;
  94.  
  95. import java.util.List;
  96.  
  97. public class Patient{
  98.  
  99. private List<Person> Patient;
  100. private List<Allergy_2> allergies;
  101.  
  102. public List<Person> getPatient() {
  103. return Patient;
  104. }
  105.  
  106. public void setPatient(List<Person> patient) {
  107. Patient = patient;
  108. }
  109.  
  110. public List<Allergy_2> getAllergies() {
  111. return allergies;
  112. }
  113.  
  114. public void setAllergies(List<Allergy_2> allergies) {
  115. this.allergies = allergies;
  116. }
  117.  
  118. public Patient(List<Person> patient, List<Allergy_2> allergies) {
  119. super();
  120. Patient = patient;
  121. this.allergies = allergies;
  122. }
  123.  
  124.  
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement