use of org.onebusaway.admin.comparator.InferredPhaseComparator in project onebusaway-application-modules by camsys.
the class VehicleStatusServiceImpl method sort.
@Override
public void sort(List<VehicleStatus> vehiclesPerPage, String field, String order) {
VehicleSortFields sortField = VehicleSortFields.valueOf(field.toUpperCase());
Comparator<VehicleStatus> fieldComparator = null;
switch(sortField) {
case VEHICLEID:
fieldComparator = new VehicleIdComparator(order);
break;
case LASTUPDATE:
fieldComparator = new LastUpdateComparator(order);
break;
case INFERREDPHASE:
fieldComparator = new InferredPhaseComparator(order);
break;
case OBSERVEDDSC:
fieldComparator = new ObservedDSCComparator(order);
break;
case PULLOUTTIME:
fieldComparator = new PulloutTimeComparator(order);
break;
case PULLINTIME:
fieldComparator = new PullinTimeComparator(order);
break;
default:
fieldComparator = new VehicleIdComparator(order);
break;
}
Collections.sort(vehiclesPerPage, fieldComparator);
}
Aggregations