public final class TerminalFinder extends Object
Constructor and Description |
---|
TerminalFinder(Comparator<Terminal> comparator) |
TerminalFinder(List<Predicate<Terminal>> predicates)
Constructs a TerminalFinder based on the given list of predicates, which defines a comparator based on the
following rules: a terminal t1 is better than a terminal t2 if the first predicate in the list on which t1 is
satisfied is before the first predicate in the list on which t2 is satisfied.
|
Modifier and Type | Method and Description |
---|---|
Optional<? extends Terminal> |
find(Iterable<? extends Terminal> terminals) |
Optional<? extends Terminal> |
find(Stream<? extends Terminal> terminals) |
static TerminalFinder |
getDefault() |
public TerminalFinder(Comparator<Terminal> comparator)
public TerminalFinder(List<Predicate<Terminal>> predicates)
predicates
- the list of predicatespublic static TerminalFinder getDefault()
public Optional<? extends Terminal> find(Iterable<? extends Terminal> terminals)
terminals
- the terminals among which a terminal has to be chosenCopyright © 2020. All rights reserved.