Esempio n. 1
0
 public void execute() throws InvalidOperation {
   List<Employee> employees = _entity.getListOfEmployees();
   Collections.sort(employees, new SortEmployeesByKey());
   for (Employee e : employees) {
     IO.println(e.toString());
   }
 }
Esempio n. 2
0
 /** Changes the Tree's habitat */
 public void execute() throws InvalidOperation {
   String key;
   Tree t;
   Decidous d;
   try {
     key = IO.readString(treeKeyReq());
     t = _entity.getTree(key);
     if (t.getType().compareTo(caduca()) == 0) {
       d = (Decidous) t;
       while (((key = IO.readString(treeNewBiological())).compareTo(withLeaves()) != 0)
           && (key.compareTo(withoutLeaves()) != 0)
           && (key.compareTo(fallingLeaves()) != 0)
           && (key.compareTo(growingLeaves()) != 0)) ;
       d.setBiologicalCycle(key);
       _entity.setChanged(true);
     }
     return;
   } catch (IOException e) {
     IO.println(e.toString());
     return;
   }
 }