summaryrefslogtreecommitdiffstats
path: root/DataStructure/MeasurementReport.java
blob: ee066677593a4e79c78318af51201666154ecf1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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