persistable sclass TickerSequence is IntSize { new LongBuffer timestamps; new DoubleBuffer prices; void add(double price, long timestamp) { timestamps.add(timestamp); prices.add(price); } void add(double[] prices, long[] timestamps) { assertEquals(l(prices), l(timestamps)); this.prices.addAll(asList(prices)); this.timestamps.addAll(asList(timestamps)); } toString { ret "TickerSequence length " + n2(l(prices)); } TickerSequence subSequence(int start, int end) { new TickerSequence s; s.add( subDoubleArray(prices.toArray(), start, end), subArray(timestamps.toArray(), start, end)); ret s; } public int size() { ret l(prices); } }