package lookup; import DataStructure.GPScoordinate; /** * Saves a GPS coordinate from the Lookup. Also stores how often that coordinate * was chosen or hit. * * @author richy * */ public class ScoreElement implements Comparable { public int occurrence; // how often was this coordinate chosen based on // Signalstrength public int ratio_hit; // how often was this coordinate chosen based on // SignalRatio public GPScoordinate gps; private double score; // 0-1 public ScoreElement(GPScoordinate reference) { gps = reference; } public void inc_occurence(GPScoordinate gps) { if (this.gps.equals(gps)) { occurrence++; } } public String toString() { return ("Hits:" + occurrence + " Coord:" + gps.coord1 + "," + gps.coord2); } public int compareTo(ScoreElement e) { if (occurrence < e.occurrence) return -1; else if (occurrence > e.occurrence) return 1; else return 0; } }