Class MatchingUtils
java.lang.Object
org.tudalgo.algoutils.tutor.general.match.MatchingUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TfirstMatch(Collection<T> objects, Matcher<? super T> matcher) Returns the object in the given collection matched by the given matcher with the highest match score.static <T> List<T>matches(Collection<T> objects, Matcher<? super T> matcher) Returns a list of all objects in the given collection matched by the given matcher sorted by match scores in descending order.
-
Constructor Details
-
MatchingUtils
public MatchingUtils()
-
-
Method Details
-
matches
Returns a list of all objects in the given collection matched by the given matcher sorted by match scores in descending order.
- Type Parameters:
T- the type of objects- Parameters:
objects- the collection of objectsmatcher- the matcher- Returns:
- the list of matched objects
-
firstMatch
Returns the object in the given collection matched by the given matcher with the highest match score.
If there is not such an object, null is returned.
- Type Parameters:
T- the type of objects- Parameters:
objects- the collection of objectsmatcher- the matcher- Returns:
- the matched object or null
-