}
}
-
+ /**
+ * Makes an 'empty' flight data branch which has no data but all built in data types are defined.
+ */
+ public FlightDataBranch() {
+ branchName = "Empty branch";
+ for (FlightDataType type : FlightDataType.ALL_TYPES){
+ this.setValue(type, Double.NaN);
+ }
+ this.immute();
+ }
/**
* Adds a new point into the data branch. The value for all types is set to NaN by default.
mutable.check();
ArrayList<Double> list = values.get(type);
+
if (list == null) {
-
list = new ArrayList<Double>();
int n = getLength();
for (int i = 0; i < n; i++) {
}
values.put(type, list);
minValues.put(type, value);
- maxValues.put(type, value);
-
+ maxValues.put(type, value);
}
- list.set(list.size() - 1, value);
+
+ if (list.size() > 0){
+ list.set(list.size() - 1, value);
+ }
+
double min = minValues.get(type);
double max = maxValues.get(type);