MCPcopy
hub / github.com/careercup/ctci / getHandlerForCall

Method getHandlerForCall

java/Chapter 8/Question8_2/CallHandler.java:63–73  ·  view source on GitHub ↗
(Call call)

Source from the content-addressed store, hash-verified

61
62 /* Gets the first available employee who can handle this call. */
63 public Employee getHandlerForCall(Call call) {
64 for (int level = call.getRank().getValue(); level < LEVELS - 1; level++) {
65 List<Employee> employeeLevel = employeeLevels.get(level);
66 for (Employee emp : employeeLevel) {
67 if (emp.isFree()) {
68 return emp;
69 }
70 }
71 }
72 return null;
73 }
74
75 /* Routes the call to an available employee, or saves in a queue if no employee available. */
76 public void dispatchCall(Caller caller) {

Callers 1

dispatchCallMethod · 0.95

Calls 4

getValueMethod · 0.45
getRankMethod · 0.45
getMethod · 0.45
isFreeMethod · 0.45

Tested by

no test coverage detected