All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mozafaq.extmergesort.ComparisionIterator Maven / Gradle / Ivy

There is a newer version: 2.0.4.RELEASE
Show newest version
package com.mozafaq.extmergesort;

import java.util.Comparator;
import java.util.Iterator;

/**
 * @author Mozaffar Afaque
 */
public interface ComparisionIterator extends Iterator {
    T current();
    default int compareToCurrent(Comparator comparator, T other) {

        T thisOne = current();
        if (thisOne == null) {
            return -1;
        }
        return comparator.compare(thisOne, other);
    };
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy