+ public AltosTelemetry next() {
+ return iterator.next().telem;
+ }
+
+ public void remove () {
+ }
+}
+
+public class AltosTelemetryIterable implements Iterable<AltosTelemetry> {
+ TreeSet<AltosTelemetryOrdered> telems;
+ int tick;
+ int index;
+
+ public void add (AltosTelemetry telem) {
+ int t = telem.tick;
+ if (!telems.isEmpty()) {
+ while (t < tick - 1000)
+ t += 65536;
+ }
+ tick = t;
+ telems.add(new AltosTelemetryOrdered(telem, index++, tick));
+ }
+
+ public Iterator<AltosTelemetry> iterator () {
+ return new AltosTelemetryOrderedIterator(telems);
+ }
+
+ public AltosTelemetryIterable (FileInputStream input) {
+ telems = new TreeSet<AltosTelemetryOrdered> ();
+ tick = 0;
+ index = 0;