package DataStructure; import java.util.Date; import java.util.LinkedList; public class MeasurementReport { private LinkedList MR = new LinkedList(); public Date time = new Date(); // Constructor public MeasurementReport() { // MR = new LinkedList(); } // TODO: think of a way to get data out of this structure (eg. as array, // etc.) // add a new BTS to list public void add(SingleBTS BTS) { // SingleBTS current; // int i = 0; // BTS with same frequency already existing? If so, average // while ((!MR.isEmpty()) && (current = MR.get(i)) != null) { // if (current.ARFCN == BTS.ARFCN) { // System.out.println("DEBUG: Element found. Averaging"); // current.addBTSMeasure(BTS); // MR.remove(i); // MR.add(i, current); // break; // only one duplicate BTS should exist // } else { MR.add(BTS); // } // } } public void add(String SqlStatement) { String[] answers = SqlStatement.split(","); // WARNING get only first BTS here. Problem: ARFCN is unknown! SingleBTS BTS = new SingleBTS(123, Integer.parseInt(answers[3]), Integer.parseInt(answers[13]), false, null, "unknown"); add(BTS); } // returns RX-Quality of first BTS in the Measurement public String toString() { return time.toString() + ";" + MR.getFirst().toString(); } public int getFirstBTSul() { return (int) MR.getFirst().getUldB(); } public int getFirstBTSdl() { return (int) MR.getFirst().getDldB(); } } // Stores single BTS information