Package com.powsybl.iidm.network.util
Class TerminalFinder
java.lang.Object
com.powsybl.iidm.network.util.TerminalFinder
A class which allows to find the best terminal, according to given comparator or list of predicate, among several
terminals.
- Author:
- Florian Dupuy <florian.dupuy at rte-france.com>
-
Constructor Summary
ConstructorDescriptionTerminalFinder
(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. -
Method Summary
-
Constructor Details
-
TerminalFinder
-
TerminalFinder
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.- Parameters:
predicates
- the list of predicates
-
-
Method Details
-
getDefault
-
find
- Parameters:
terminals
- the terminals among which a terminal has to be chosen- Returns:
- a terminal among the best ones based on the comparator field
-
find
- Parameters:
terminals
- the terminals among which a terminal has to be chosen- Returns:
- a terminal among the best ones based on the comparator field
-