package lookup; import helper.ListGPS; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import DataStructure.GPScoordinate; import DataStructure.GSMMap; import DataStructure.SingleBTS; /** * Throw in one or more MR (BTS-list). Get Score Element with possible * Coordinates. This GSMLut uses ScoreElements to represent coordinates and * their possibility. NOT USED!!!! * * @author richy * */ public class GSMLut { // private GSMMap map; private SingleBTS[] content; private ArrayList lookups = new ArrayList(); /** * Create inverse of map * * @param map * GSMmap to use */ public GSMLut(GSMMap map) { // this.map = map; content = map.getUniqueBTSlist(); // check if content also contains // E-Plus arfcn! for (SingleBTS current : content) { // create a LUT for every BTS lookups.add(new BTSLut(current.ARFCN, map, 20, 20)); // traverse the whole GSMmap, add values to BTSLut } } public LinkedList find(List MR) { // traverse lookups. Build result array // LinkedList> set = new // LinkedList>(); LinkedList set = new LinkedList(); for (ILut lut : lookups) { set.addAll(lut.get(MR)); // set.add(lut.get(MR)); } // no intersect // return ListGPS.intersect(set); return set; } /** * Returns Score Elements. No intersect is done. Only common Coordinates are * counted. This should be a better way to start! * * @param MR * @return */ public LinkedList findWithScore(List MR) { LinkedList resultset = find(MR); // get unique coords GPScoordinate[] unique = ListGPS.content(resultset); ArrayList scores = new ArrayList( unique.length); for (GPScoordinate coord : unique) { scores.add(new ScoreElement(coord)); } // score elements are initialized. traverse the whole result set now ListIterator itr = resultset.listIterator(); for (int i = 0; i < scores.size(); i++) { while (itr.hasNext()) { } // reset itr } return null; } }