
com.fathzer.games.util.SelectiveComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of games-core Show documentation
Show all versions of games-core Show documentation
A core library to help implement two players games.
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