1
2
3
4
5
6
7
8public
9class Diff extends Sequence {
10 private
11 long last;
12
13 private
14 Sequence s;
15
16 public
17 Diff(Sequence s) {
18 this.s = s;
19 this.last = s.next();
20 }
21
22 public
23 long next() {
24 long i0 = last;
25
26 last = s.next();
27
28 return last - i0;
29 }
30}
31
32
33