diff options
| author | SammysHP <sven@sammyshp.de> | 2011-09-14 21:42:32 +0200 |
|---|---|---|
| committer | SammysHP <sven@sammyshp.de> | 2011-09-14 21:42:32 +0200 |
| commit | 4f7c67407019de18fd53b640edb9682a346fbfef (patch) | |
| tree | 5a1d10843e8f5104e4202211f4792b5bfe830cb6 /src/cgeo/geocaching/sorting/VoteComparator.java | |
| parent | 90e7bf968f6722b8df8b884f37617e7fc78901b5 (diff) | |
| download | cgeo-4f7c67407019de18fd53b640edb9682a346fbfef.zip cgeo-4f7c67407019de18fd53b640edb9682a346fbfef.tar.gz cgeo-4f7c67407019de18fd53b640edb9682a346fbfef.tar.bz2 | |
Formatting
Diffstat (limited to 'src/cgeo/geocaching/sorting/VoteComparator.java')
| -rw-r--r-- | src/cgeo/geocaching/sorting/VoteComparator.java | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/cgeo/geocaching/sorting/VoteComparator.java b/src/cgeo/geocaching/sorting/VoteComparator.java index 0039c7c..181b19c 100644 --- a/src/cgeo/geocaching/sorting/VoteComparator.java +++ b/src/cgeo/geocaching/sorting/VoteComparator.java @@ -4,36 +4,36 @@ import cgeo.geocaching.cgCache; /** * sorts caches by the users own voting (if available at all) - * + * * @author bananeweizen - * + * */ public class VoteComparator extends AbstractCacheComparator { - @Override - protected boolean canCompare(cgCache cache1, cgCache cache2) { - return true; - } + @Override + protected boolean canCompare(cgCache cache1, cgCache cache2) { + return true; + } - @Override - protected int compareCaches(cgCache cache1, cgCache cache2) { - // if there is no vote available, put that cache at the end of the list - float vote1 = 0; - if (cache1.myVote != null) { - vote1 = cache1.myVote; - } + @Override + protected int compareCaches(cgCache cache1, cgCache cache2) { + // if there is no vote available, put that cache at the end of the list + float vote1 = 0; + if (cache1.myVote != null) { + vote1 = cache1.myVote; + } - float vote2 = 0; - if (cache2.myVote != null) { - vote2 = cache2.myVote; - } + float vote2 = 0; + if (cache2.myVote != null) { + vote2 = cache2.myVote; + } - // compare - if (vote1 < vote2) { - return 1; - } else if (vote2 < vote1) { - return -1; - } - return 0; - } + // compare + if (vote1 < vote2) { + return 1; + } else if (vote2 < vote1) { + return -1; + } + return 0; + } } |
