Beispiel #1
0
 public void removeChild(Person barn) {
   if (this.isMale()) {
     barn.setFather(null);
   } else if (this.isFemale()) {
     barn.setMother(null);
   }
 }
Beispiel #2
0
 public void addChild(Person barn) {
   if (!this.children.contains(barn)) {
     if (this.isMale()) {
       barn.setFather(this);
     } else if (this.isFemale()) {
       barn.setMother(this);
     }
   }
 }