Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / JU / ListDataReader.js
1 Clazz.declarePackage ("JU");
2 Clazz.load (["JU.DataReader"], "JU.ListDataReader", null, function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.data = null;
5 this.pt = 0;
6 this.len = 0;
7 Clazz.instantialize (this, arguments);
8 }, JU, "ListDataReader", JU.DataReader);
9 Clazz.overrideMethod (c$, "setData", 
10 function (data) {
11 this.data = data;
12 this.len = this.data.size ();
13 return this;
14 }, "~O");
15 Clazz.overrideMethod (c$, "read", 
16 function (buf, off, len) {
17 return this.readBuf (buf, off, len);
18 }, "~A,~N,~N");
19 Clazz.overrideMethod (c$, "readLine", 
20 function () {
21 return (this.pt < this.len ? this.data.get (this.pt++) : null);
22 });
23 Clazz.defineMethod (c$, "mark", 
24 function (ptr) {
25 this.ptMark = this.pt;
26 }, "~N");
27 Clazz.overrideMethod (c$, "reset", 
28 function () {
29 this.pt = this.ptMark;
30 });
31 });