switch (updatedLoanOrder.getType()) {
case ASK:
it = floatingRateAsks.iterator();
while (it.hasNext()) {
FloatingRateLoanOrder order = it.next();
if (order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) {
it.remove();
}
// check if the rate has changed and whether we know if it has changed
if (!order.getRate().equals(updatedLoanOrder.getRate()) && !rateChanged) {
rateChanged = true;
}
break;
}
floatingRateAsks.add(updatedLoanOrder);
Collections.sort(floatingRateAsks);
break;
case BID:
it = floatingRateBids.iterator();
while (it.hasNext()) {
FloatingRateLoanOrder order = it.next();
if (order.getDayPeriod() == updatedLoanOrder.getDayPeriod()) {
it.remove();
}
// check if the rate has changed and whether we know if it has changed
if (!order.getRate().equals(updatedLoanOrder.getRate()) && !rateChanged) {
rateChanged = true;
}
break;
}
floatingRateBids.add(updatedLoanOrder);
Collections.sort(fixedRateBids);
break;
default:
break;
}
if (rateChanged) {
for (FloatingRateLoanOrder order : floatingRateAsks) {
order.setRate(updatedLoanOrder.getRate());
}
for (FloatingRateLoanOrder order : floatingRateBids) {
order.setRate(updatedLoanOrder.getRate());
}
}
updateTimestamp(updatedLoanOrder.getTimestamp());
}