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

com.fathzer.games.util.SelectiveComparator Maven / Gradle / Ivy

The newest version!
package com.fathzer.games.util;

import java.util.Comparator;
import java.util.function.Predicate;

/** A comparator combined with a Predicate that returns false if an element should not be sorted.
 * 
It allows to implement the partial sort in {@link MoveList} * @param The type of elements */ public interface SelectiveComparator extends Comparator, Predicate { /** Checks if an element should be sorted or not. * @param t The element to test * @return true if element should be sorted, false if not.
The default implementation returns true (all elements should be sorted). */ @Override default boolean test(T t) { return true; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy