X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=site%2Fj2s%2FJU%2FListDataReader.js;fp=site%2Fj2s%2FJU%2FListDataReader.js;h=4a6988ce2496da8e5b51f5e47f5ec433543a35b6;hb=4231d40261fef32ce4570a6bbad0d35df44e8baf;hp=0000000000000000000000000000000000000000;hpb=c07eb2c5794833bd0241000d6844d783fe10cb82;p=jalview.git diff --git a/site/j2s/JU/ListDataReader.js b/site/j2s/JU/ListDataReader.js new file mode 100644 index 0000000..4a6988c --- /dev/null +++ b/site/j2s/JU/ListDataReader.js @@ -0,0 +1,31 @@ +Clazz.declarePackage ("JU"); +Clazz.load (["JU.DataReader"], "JU.ListDataReader", null, function () { +c$ = Clazz.decorateAsClass (function () { +this.data = null; +this.pt = 0; +this.len = 0; +Clazz.instantialize (this, arguments); +}, JU, "ListDataReader", JU.DataReader); +Clazz.overrideMethod (c$, "setData", +function (data) { +this.data = data; +this.len = this.data.size (); +return this; +}, "~O"); +Clazz.overrideMethod (c$, "read", +function (buf, off, len) { +return this.readBuf (buf, off, len); +}, "~A,~N,~N"); +Clazz.overrideMethod (c$, "readLine", +function () { +return (this.pt < this.len ? this.data.get (this.pt++) : null); +}); +Clazz.defineMethod (c$, "mark", +function (ptr) { +this.ptMark = this.pt; +}, "~N"); +Clazz.overrideMethod (c$, "reset", +function () { +this.pt = this.ptMark; +}); +});