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.displaytag.model.RowSorter.java

/**
 * Comparator for rows.
 * @author Fabrizio Giustina
 * @version $Revision: 1.13 $ ($Author: fgiust $)
 */
public class RowSorter implements Comparator {

From source file org.apereo.portal.io.xml.eventaggr.ExternalAggregatedGroupMappingComparator.java

/**
 * Sort group mappings
 * 
 * @author Eric Dalquist
 */
public class ExternalAggregatedGroupMappingComparator implements Comparator<ExternalAggregatedGroupMapping> {

From source file org.apache.ode.daohib.bpel.ql.StateComparator.java

class StateComparator implements Comparator<HProcessInstance> {

    private static final short[] order = {
            //"active" status
            ProcessState.STATE_ACTIVE, ProcessState.STATE_NEW, ProcessState.STATE_READY,
            //"completed"

From source file gov.va.isaac.search.CompositeSearchResultComparator.java

/**
 * A {@link Comparator} for {@link SearchResult} objects.
 *
 * @author ocarlsen
 * @author <a href="mailto:daniel.armbrust.list@gmail.com">Dan Armbrust</a>
 */

From source file DirList.java

class AlphabeticComparator implements Comparator {
    public int compare(Object o1, Object o2) {
        String s1 = (String) o1;
        String s2 = (String) o2;
        return s1.toLowerCase().compareTo(s2.toLowerCase());
    }

From source file Person.java

class LastNameComparator implements Comparator {
    public int compare(Object person, Object anotherPerson) {
        String lastName1 = ((Person) person).getLastName().toUpperCase();
        String firstName1 = ((Person) person).getFirstName().toUpperCase();
        String lastName2 = ((Person) anotherPerson).getLastName().toUpperCase();
        String firstName2 = ((Person) anotherPerson).getFirstName().toUpperCase();

From source file Person.java

class LastNameComparator implements Comparator {
    public int compare(Object person, Object anotherPerson) {
        String lastName1 = ((Person) person).getLastName().toUpperCase();
        String firstName1 = ((Person) person).getFirstName().toUpperCase();
        String lastName2 = ((Person) anotherPerson).getLastName().toUpperCase();
        String firstName2 = ((Person) anotherPerson).getFirstName().toUpperCase();

From source file org.nuxeo.ecm.platform.ui.web.directory.SelectItemComparator.java

/**
 * Orders select items by id or label, handling localization.
 *
 * @author <a href="mailto:glefter@nuxeo.com">George Lefter</a>
 */
public class SelectItemComparator implements Comparator<SelectItem>, Serializable {

From source file ComparatorExampleForUserDefinedClass.java

class NameComparator implements Comparator {
    public int compare(Object o1, Object o2) {
        if (o1 instanceof String && o2 instanceof String) {
            String s1 = (String) o1;
            String s2 = (String) o2;
            s1 = s1.substring(0, s1.indexOf("-"));

From source file org.calrissian.flowmix.core.support.EventSortByComparator.java

public class EventSortByComparator implements Comparator<WindowItem> {

    private static ComparableComparator comparator = new ComparableComparator();
    private List<Pair<String, Order>> sortBy;

    public EventSortByComparator(List<Pair<String, Order>> sortBy) {