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 String firstName[];
|
||||||
public Gender gender;
|
public Gender gender;
|
||||||
public Person spouse;
|
public Person spouse;
|
||||||
//public Society society;
|
public Society society;
|
||||||
public String function;
|
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.lastName = lastName;
|
||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
this.gender = gender;
|
this.gender = gender;
|
||||||
this.spouse = spouse;
|
this.spouse = spouse;
|
||||||
//this.society = society
|
this.society = society;
|
||||||
this.function = function;
|
this.function = function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ public class Person implements Input{
|
||||||
out += firstNames + " " + lastName;
|
out += firstNames + " " + lastName;
|
||||||
else
|
else
|
||||||
out += lastName + " " + firstNames;
|
out += lastName + " " + firstNames;
|
||||||
/*if (society != null)
|
if (society != null)
|
||||||
out += " (" + society.socialReason + ")";*/
|
out += " (" + society.socialReason + ")";
|
||||||
break;
|
break;
|
||||||
case COMPLETE:
|
case COMPLETE:
|
||||||
out = gender == Gender.MEN ? "Mr. " : "Ms. " ;
|
out = gender == Gender.MEN ? "Mr. " : "Ms. " ;
|
||||||
|
@ -50,8 +50,8 @@ public class Person implements Input{
|
||||||
out = firstNames + " " + lastName + "\n";
|
out = firstNames + " " + lastName + "\n";
|
||||||
else
|
else
|
||||||
out = lastName + " " + firstNames + "\n";
|
out = lastName + " " + firstNames + "\n";
|
||||||
/*if (society != null)
|
if (society != null)
|
||||||
out += "\t- Society: " + society.socialReason + "\n";*/
|
out += "\t- Society: " + society.socialReason + "\n";
|
||||||
if (!function.equals(""))
|
if (!function.equals(""))
|
||||||
out += "\t- Function: " + function;
|
out += "\t- Function: " + function;
|
||||||
break;
|
break;
|
||||||
|
|
Reference in a new issue