Updates the current best-match set using the supplied distance metric. @param matchesDistance the best distance seen so far @param matches the current best candidates @param method the candidate method @param dist the candidate distance @return the updated best distance
(long matchesDistance, LinkedList matches, Object method, long dist)
| 3627 | * @return the updated best distance |
| 3628 | */ |
| 3629 | protected static long handleMatches(long matchesDistance, LinkedList matches, Object method, long dist) { |
| 3630 | if (matches.isEmpty()) { |
| 3631 | matches.add(method); |
| 3632 | matchesDistance = dist; |
| 3633 | } else if (dist < matchesDistance) { |
| 3634 | matchesDistance = dist; |
| 3635 | matches.clear(); |
| 3636 | matches.add(method); |
| 3637 | } else if (dist == matchesDistance) { |
| 3638 | matches.add(method); |
| 3639 | } |
| 3640 | return matchesDistance; |
| 3641 | } |
| 3642 | |
| 3643 | /** |
| 3644 | * Complete the initialisation process. After this method |
no test coverage detected