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 load.solver.ComputerStrengthComparator.java

public class ComputerStrengthComparator implements Comparator<Computer>, Serializable {

    public int compare(Computer a, Computer b) {
        return new CompareToBuilder().append(a.getCpuPower(), b.getCpuPower()).toComparison();
    }

From source file de.hybris.platform.acceleratorservices.dataimport.batch.FileOrderComparator.java

/**
 * Comparator that compares files based on their file names. On this behalf a priorities are configurable for file name
 * prefixes. Files with a lower priority value are considered more important and imported first. This ensures some files
 * are imported before others (e.g. products before prices).
 */
public class FileOrderComparator implements Comparator<File>, InitializingBean {

From source file org.optaplanner.osgi.common.domain.PersistableIdComparator.java

public class PersistableIdComparator implements Comparator<AbstractPersistable>, Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -3482663212421071202L;

From source file org.springmodules.validation.util.condition.range.PersonByAgeComparator.java

/**
 * @author Uri Boness
 */
public class PersonByAgeComparator implements Comparator {

    public int compare(Object o1, Object o2) {

From source file org.optaconf.benchmark.examples.common.domain.PersistableIdComparator.java

public class PersistableIdComparator implements Comparator<AbstractPersistable>, Serializable {

    public int compare(AbstractPersistable a, AbstractPersistable b) {
        return new CompareToBuilder().append(a.getId(), b.getId()).toComparison();
    }

From source file com.web.vehiclerouting.optaplanner.common.domain.PersistableIdComparator.java

public class PersistableIdComparator implements Comparator<AbstractPersistable>, Serializable {

    public int compare(AbstractPersistable a, AbstractPersistable b) {
        return new CompareToBuilder().append(a.getId(), b.getId()).toComparison();
    }

From source file org.kuali.kra.irb.actions.print.QuestionnairePrintOptionComparator.java

/**
 * 
 * This class is to implement the comparator questionnaire print items.
 */
public class QuestionnairePrintOptionComparator implements Comparator<QuestionnairePrintOption> {

From source file org.duracloud.snapshot.db.model.SnapshotContentItem.java

/**
 * @author Daniel Bernstein
 *         Date: Jul 21, 2014
 */
@Entity
@Table(name = "snapshot_content_item", uniqueConstraints = @UniqueConstraint(columnNames = { "snapshot_id",

From source file poisondog.commons.vfs.LastModifiedComparator.java

/**
 * @author Adam Huang <poisondog@gmail.com>
 */
public class LastModifiedComparator implements Comparator<FileObject> {
    public int compare(FileObject obj1, FileObject obj2) {
        try {

From source file ch.ledcom.log4jtools.utils.FilenameComparator.java

public class FilenameComparator implements Comparator<File> {
    @Override
    public final int compare(File f1, File f2) {
        DateTime d1 = ParseUtils.extractDateFromName(f1);
        Integer s1 = ParseUtils.extractSequenceFromName(f1);
        DateTime d2 = ParseUtils.extractDateFromName(f2);