sclass PtBuffer > RandomAccessAbstractList { LongBuffer buf = new LongBuffer; *() {} *(int size) { buf.allocate(size); } *(Iterable l) { if (l != null) for (Pt p : l) add(p); } public int size() { ret buf.size(); } public Pt get(int i) { ret longToPt(buf.get(i)); } public long getLong(int i) { ret buf.get(i); } public Pt set(int i, Pt val) { Pt old = get(i); buf.set(i, ptToLong(val)); ret old; } public bool add(Pt p) { buf.add(ptToLong(p)); true; } public void add(int x, int y) { buf.add(ptToLong(x, y)); } public Pt remove(int i) { Pt p = get(i); buf.remove(i); ret p; } public void clear { buf.clear(); } }