Implement Society in Person class
This commit is contained in:
parent
1c5ca0b434
commit
a04ebdae04
1 changed files with 7 additions and 7 deletions
|
@ -5,15 +5,15 @@ public class Person implements Input{
|
|||
public String firstName[];
|
||||
public Gender gender;
|
||||
public Person spouse;
|
||||
//public Society society;
|
||||
public Society society;
|
||||
public String function;
|
||||
|
||||
public Person(String lastName, String[] firstName, Gender gender, Person spouse, String function) {
|
||||
public Person(String lastName, String[] firstName, Gender gender, Person spouse, Society society, String function) {
|
||||
this.lastName = lastName;
|
||||
this.firstName = firstName;
|
||||
this.gender = gender;
|
||||
this.spouse = spouse;
|
||||
//this.society = society
|
||||
this.society = society;
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@ public class Person implements Input{
|
|||
out += firstNames + " " + lastName;
|
||||
else
|
||||
out += lastName + " " + firstNames;
|
||||
/*if (society != null)
|
||||
out += " (" + society.socialReason + ")";*/
|
||||
if (society != null)
|
||||
out += " (" + society.socialReason + ")";
|
||||
break;
|
||||
case COMPLETE:
|
||||
out = gender == Gender.MEN ? "Mr. " : "Ms. " ;
|
||||
|
@ -50,8 +50,8 @@ public class Person implements Input{
|
|||
out = firstNames + " " + lastName + "\n";
|
||||
else
|
||||
out = lastName + " " + firstNames + "\n";
|
||||
/*if (society != null)
|
||||
out += "\t- Society: " + society.socialReason + "\n";*/
|
||||
if (society != null)
|
||||
out += "\t- Society: " + society.socialReason + "\n";
|
||||
if (!function.equals(""))
|
||||
out += "\t- Function: " + function;
|
||||
break;
|
||||
|
|
Reference in a new issue