]> git.uio.no Git - ifi-stolz-refaktor.git/blame - software/no.uio.ifi.refaktor/src/no/uio/ifi/refaktor/analyze/comparators/FavorNoUnfixesCandidateComparator.java
ExtractAndMoveMethodAnalysisResult: renaming to ExtractAndMoveMethodCandidate
[ifi-stolz-refaktor.git] / software / no.uio.ifi.refaktor / src / no / uio / ifi / refaktor / analyze / comparators / FavorNoUnfixesCandidateComparator.java
CommitLineData
d6c79186
EK
1package no.uio.ifi.refaktor.analyze.comparators;
2
7fa217a1 3import no.uio.ifi.refaktor.analyze.ExtractAndMoveMethodCandidate;
14dc9ff0 4
7fa217a1 5public final class FavorNoUnfixesCandidateComparator implements ExtractAndMoveMethodCandidateComparator {
14dc9ff0 6 @Override
7fa217a1 7 public int compare(ExtractAndMoveMethodCandidate resultOne, ExtractAndMoveMethodCandidate resultTwo) {
14dc9ff0
EK
8 if (resultOne.hasNoUnfixes() && resultTwo.hasUnfixes())
9 return 1;
10 else if (resultOne.hasUnfixes() && resultTwo.hasNoUnfixes())
11 return -1;
12 else if (resultOne.hasOnlyOnePossibleTarget() && resultTwo.hasMoreThanOnePossibleTarget())
13 return 1;
14 else if (resultOne.hasMoreThanOnePossibleTarget() && resultTwo.hasOnlyOnePossibleTarget())
15 return -1;
16 else if (resultOne.hasMoreThanOnePossibleTarget() && resultTwo.hasMoreThanOnePossibleTarget())
17 return 0;
18 else if (resultOne.getTargetFrequency() > resultTwo.getTargetFrequency())
19 return 1;
20 else if (resultOne.getTargetFrequency() < resultTwo.getTargetFrequency())
21 return -1;
22 else
23 return 0;
24 }
25}