Example usage for java.util Comparator interface-usage

List of usage examples for java.util Comparator interface-usage

Introduction

In this page you can find the example usage for java.util Comparator interface-usage.

Usage

From source file org.onebusaway.nyc.vehicle_tracking.impl.sort.NycTestLocationRecordDestinationSignCodeComparator.java

public class NycTestLocationRecordDestinationSignCodeComparator implements Comparator<NycTestLocationRecord> {

    @Override
    public int compare(NycTestLocationRecord o1, NycTestLocationRecord o2) {
        return new CompareToBuilder().append(o1.getDsc(), o2.getDsc()).toComparison();
    }

From source file org.onebusaway.nyc.vehicle_tracking.impl.sort.NycTestLocationRecordVehicleComparator.java

public class NycTestLocationRecordVehicleComparator implements Comparator<NycTestLocationRecord> {

    @Override
    public int compare(NycTestLocationRecord o1, NycTestLocationRecord o2) {
        return new CompareToBuilder().append(o1.getVehicleId(), o2.getVehicleId()).toComparison();
    }

From source file org.drools.planner.benchmark.WorstScoreSolverBenchmarkComparator.java

/**
 * @author Geoffrey De Smet
 */
public class WorstScoreSolverBenchmarkComparator implements Comparator<SolverBenchmark> {

    public int compare(SolverBenchmark a, SolverBenchmark b) {

From source file cl.citymovil.route_pro.solver.solution.util.LatitudeCustomerDifficultyComparator.java

/**
 * On large datasets, the constructed solution looks like a zebra crossing.
 */
public class LatitudeCustomerDifficultyComparator implements Comparator<Customer>, Serializable {

    private static final long serialVersionUID = 1L;

From source file com.web.vehiclerouting.optaplanner.domain.solver.VrpCustomerDifficultyComparator.java

public class VrpCustomerDifficultyComparator implements Comparator<Customer>, Serializable {

    public int compare(Customer a, Customer b) {
        return new CompareToBuilder()
                // TODO experiment with (aLatitude - bLatitude) % 10
                .append(a.getLocation().getLatitude(), b.getLocation().getLatitude())

From source file com.jobplanner.solver.ShiftAssignmentDifficultyComparator.java

public class ShiftAssignmentDifficultyComparator implements Comparator<ShiftAssignment>, Serializable {

    public int compare(ShiftAssignment a, ShiftAssignment b) {
        Shift aShift = a.getShift();
        Shift bShift = b.getShift();
        return new CompareToBuilder().append(bShift.getShiftDate(), aShift.getShiftDate()) // Descending

From source file org.onebusaway.nyc.vehicle_tracking.impl.sort.NycQueuedInferredLocationBeanVehicleComparator.java

public class NycQueuedInferredLocationBeanVehicleComparator implements Comparator<NycQueuedInferredLocationBean> {

    @Override
    public int compare(NycQueuedInferredLocationBean o1, NycQueuedInferredLocationBean o2) {
        return new CompareToBuilder().append(o1.getVehicleId(), o2.getVehicleId()).toComparison();
    }

From source file com.employee.scheduler.nurserostering.domain.solver.EmployeeStrengthComparator.java

public class EmployeeStrengthComparator implements Comparator<Employee>, Serializable {

    public int compare(Employee a, Employee b) {
        // TODO refactor to DifficultyWeightFactory and use getContract().getContractLineList()
        // to sum maximumValue and minimumValue etc
        return new CompareToBuilder().append(b.getWeekendLength(), a.getWeekendLength()) // Descending

From source file org.yes.cart.utils.impl.AttrValueDTOComparatorImpl.java

/**
 *
 * Compare two attr values dto by attribute name.
 *
 * User: Igor Azarny iazarny@yahoo.com
 * Date: 09-May-2011

From source file ontopoly.utils.IdentityComparator.java

public class IdentityComparator implements Comparator<Object>, Serializable {

    public static final IdentityComparator INSTANCE = new IdentityComparator();

    @Override
    public int compare(Object o1, Object o2) {