示例#1
0
 public void fillPosition(String title, Person hire) {
   for (Position position : this)
     if (position.getTitle().equals(title) && position.getPerson() == Person.NULL) {
       position.setPerson(hire);
       return;
     }
   throw new RuntimeException("Position " + title + " not available");
 }
示例#2
0
 public boolean positionAvailable(String title) {
   for (Position position : this)
     if (position.getTitle().equals(title) && position.getPerson() == Person.NULL) return true;
   return false;
 }