(Employee emp)
| 95 | /* An employee got free. Look for a waiting call that he/she can serve. Return true |
| 96 | * if we were able to assign a call, false otherwise. */ |
| 97 | public boolean assignCall(Employee emp) { |
| 98 | /* Check the queues, starting from the highest rank this employee can serve. */ |
| 99 | for (int rank = emp.getRank().getValue(); rank >= 0; rank--) { |
| 100 | List<Call> que = callQueues.get(rank); |
| 101 | |
| 102 | /* Remove the first call, if any */ |
| 103 | if (que.size() > 0) { |
| 104 | Call call = que.remove(0); |
| 105 | if (call != null) { |
| 106 | emp.receiveCall(call); |
| 107 | return true; |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | return false; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 |
no test coverage detected