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 Main.java

class PathComparator implements Comparator<String> {
    public int compare(String path1, String path2) {
        String[] dirs1 = path1.split("/");
        String[] dirs2 = path2.split("/");
        if (dirs1.length < dirs2.length) {
            return -1;

From source file org.martin.ftp.util.RemoteComparator.java

/**
 *
 * @author martin
 */
public class RemoteComparator implements Comparator<FTPFile> {

From source file com.clican.pluto.cms.core.comparator.BaseComparator.java

public abstract class BaseComparator<T> implements Comparator<T> {

    protected final Log log = LogFactory.getLog(getClass());

    public BaseComparator() {

From source file br.ufba.dcc.wiser.fot.fotbalance.optaplannertest1.solver.HostStrengthComparator.java

/**
 *
 * @author jeferson
 */
public class HostStrengthComparator implements Comparator<Host>, Serializable {

From source file br.ufba.dcc.wiser.fot.fotbalance.optaplannertest1.solver.BundleDifficultyComparator.java

/**
 *
 * @author jeferson
 */
public class BundleDifficultyComparator implements Comparator<Bundle>, Serializable {

From source file org.dspace.content.comparator.NameAscendingComparator.java

public class NameAscendingComparator implements Comparator<DSpaceObject> {

    @Override
    public int compare(DSpaceObject dso1, DSpaceObject dso2) {
        if (dso1 == dso2) {
            return 0;

From source file Main.java

class TimeStringComparator implements Comparator<String> {
    private DateFormat primaryFormat = new SimpleDateFormat("h:mm a");
    private DateFormat secondaryFormat = new SimpleDateFormat("H:mm");

    @Override
    public int compare(String time1, String time2) {

From source file org.martin.ftp.util.SearchComparator.java

/**
 *
 * @author martin
 */
public class SearchComparator implements Comparator<FileFiltering> {

From source file org.intermine.modelviewer.project.PropertyNameComparator.java

/**
 * Comparator for sorting lists of Property objects by name.
 */
public class PropertyNameComparator implements Comparator<Property> {
    /**
     * Shared-use instance of PropertyNameComparator.

From source file org.intermine.modelviewer.project.SourceNameComparator.java

/**
 * Comparator for sorting lists of Source objects by name.
 */
public class SourceNameComparator implements Comparator<Source> {
    /**
     * Shared-use instance of PropertyNameComparator.