summaryrefslogtreecommitdiffstats
path: root/DataStructure/MeasurementReport.java
diff options
context:
space:
mode:
Diffstat (limited to 'DataStructure/MeasurementReport.java')
-rw-r--r--DataStructure/MeasurementReport.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/DataStructure/MeasurementReport.java b/DataStructure/MeasurementReport.java
new file mode 100644
index 0000000..ee06667
--- /dev/null
+++ b/DataStructure/MeasurementReport.java
@@ -0,0 +1,60 @@
+package DataStructure;
+
+import java.util.Date;
+import java.util.LinkedList;
+
+public class MeasurementReport {
+ private LinkedList<SingleBTS> MR = new LinkedList<SingleBTS>();
+ public Date time = new Date();
+
+ // Constructor
+ public MeasurementReport() {
+ // MR = new LinkedList<SingleBTS>();
+ }
+
+ // 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