Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / org / xml / sax / helpers / AttributesImpl.js
index d923ed5..e0e6b68 100644 (file)
-Clazz.declarePackage ("org.xml.sax.helpers");\r
-Clazz.load (["org.xml.sax.Attributes"], "org.xml.sax.helpers.AttributesImpl", ["java.lang.ArrayIndexOutOfBoundsException"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.length = 0;\r
-this.data = null;\r
-Clazz.instantialize (this, arguments);\r
-}, org.xml.sax.helpers, "AttributesImpl", null, org.xml.sax.Attributes);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-this.length = 0;\r
-this.data = null;\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (atts) {\r
-this.setAttributes (atts);\r
-}, "org.xml.sax.Attributes");\r
-Clazz.defineMethod (c$, "getLength", \r
-function () {\r
-return this.length;\r
-});\r
-Clazz.defineMethod (c$, "getURI", \r
-function (index) {\r
-if (index >= 0 && index < this.length) {\r
-return this.data[index * 5];\r
-} else {\r
-return null;\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "getLocalName", \r
-function (index) {\r
-if (index >= 0 && index < this.length) {\r
-return this.data[index * 5 + 1];\r
-} else {\r
-return null;\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "getQName", \r
-function (index) {\r
-if (index >= 0 && index < this.length) {\r
-return this.data[index * 5 + 2];\r
-} else {\r
-return null;\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "getType", \r
-function (index) {\r
-if (index >= 0 && index < this.length) {\r
-return this.data[index * 5 + 3];\r
-} else {\r
-return null;\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "getValue", \r
-function (index) {\r
-if (index >= 0 && index < this.length) {\r
-return this.data[index * 5 + 4];\r
-} else {\r
-return null;\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "getIndex", \r
-function (uri, localName) {\r
-var max = this.length * 5;\r
-for (var i = 0; i < max; i += 5) {\r
-if (this.data[i].equals (uri) && this.data[i + 1].equals (localName)) {\r
-return Clazz.doubleToInt (i / 5);\r
-}}\r
-return -1;\r
-}, "~S,~S");\r
-Clazz.defineMethod (c$, "getIndex", \r
-function (qName) {\r
-var max = this.length * 5;\r
-for (var i = 0; i < max; i += 5) {\r
-if (this.data[i + 2].equals (qName)) {\r
-return Clazz.doubleToInt (i / 5);\r
-}}\r
-return -1;\r
-}, "~S");\r
-Clazz.defineMethod (c$, "getType", \r
-function (uri, localName) {\r
-var max = this.length * 5;\r
-for (var i = 0; i < max; i += 5) {\r
-if (this.data[i].equals (uri) && this.data[i + 1].equals (localName)) {\r
-return this.data[i + 3];\r
-}}\r
-return null;\r
-}, "~S,~S");\r
-Clazz.defineMethod (c$, "getType", \r
-function (qName) {\r
-var max = this.length * 5;\r
-for (var i = 0; i < max; i += 5) {\r
-if (this.data[i + 2].equals (qName)) {\r
-return this.data[i + 3];\r
-}}\r
-return null;\r
-}, "~S");\r
-Clazz.defineMethod (c$, "getValue", \r
-function (uri, localName) {\r
-var max = this.length * 5;\r
-for (var i = 0; i < max; i += 5) {\r
-if (this.data[i].equals (uri) && this.data[i + 1].equals (localName)) {\r
-return this.data[i + 4];\r
-}}\r
-return null;\r
-}, "~S,~S");\r
-Clazz.defineMethod (c$, "getValue", \r
-function (qName) {\r
-var max = this.length * 5;\r
-for (var i = 0; i < max; i += 5) {\r
-if (this.data[i + 2].equals (qName)) {\r
-return this.data[i + 4];\r
-}}\r
-return null;\r
-}, "~S");\r
-Clazz.defineMethod (c$, "clear", \r
-function () {\r
-if (this.data != null) {\r
-for (var i = 0; i < (this.length * 5); i++) this.data[i] = null;\r
-\r
-}this.length = 0;\r
-});\r
-Clazz.defineMethod (c$, "setAttributes", \r
-function (atts) {\r
-this.clear ();\r
-this.length = atts.getLength ();\r
-if (this.length > 0) {\r
-this.data =  new Array (this.length * 5);\r
-for (var i = 0; i < this.length; i++) {\r
-this.data[i * 5] = atts.getURI (i);\r
-this.data[i * 5 + 1] = atts.getLocalName (i);\r
-this.data[i * 5 + 2] = atts.getQName (i);\r
-this.data[i * 5 + 3] = atts.getType (i);\r
-this.data[i * 5 + 4] = atts.getValue (i);\r
-}\r
-}}, "org.xml.sax.Attributes");\r
-Clazz.defineMethod (c$, "addAttribute", \r
-function (uri, localName, qName, type, value) {\r
-this.ensureCapacity (this.length + 1);\r
-this.data[this.length * 5] = uri;\r
-this.data[this.length * 5 + 1] = localName;\r
-this.data[this.length * 5 + 2] = qName;\r
-this.data[this.length * 5 + 3] = type;\r
-this.data[this.length * 5 + 4] = value;\r
-this.length++;\r
-}, "~S,~S,~S,~S,~S");\r
-Clazz.defineMethod (c$, "setAttribute", \r
-function (index, uri, localName, qName, type, value) {\r
-if (index >= 0 && index < this.length) {\r
-this.data[index * 5] = uri;\r
-this.data[index * 5 + 1] = localName;\r
-this.data[index * 5 + 2] = qName;\r
-this.data[index * 5 + 3] = type;\r
-this.data[index * 5 + 4] = value;\r
-} else {\r
-this.badIndex (index);\r
-}}, "~N,~S,~S,~S,~S,~S");\r
-Clazz.defineMethod (c$, "removeAttribute", \r
-function (index) {\r
-if (index >= 0 && index < this.length) {\r
-if (index < this.length - 1) {\r
-System.arraycopy (this.data, (index + 1) * 5, this.data, index * 5, (this.length - index - 1) * 5);\r
-}index = (this.length - 1) * 5;\r
-this.data[index++] = null;\r
-this.data[index++] = null;\r
-this.data[index++] = null;\r
-this.data[index++] = null;\r
-this.data[index] = null;\r
-this.length--;\r
-} else {\r
-this.badIndex (index);\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "setURI", \r
-function (index, uri) {\r
-if (index >= 0 && index < this.length) {\r
-this.data[index * 5] = uri;\r
-} else {\r
-this.badIndex (index);\r
-}}, "~N,~S");\r
-Clazz.defineMethod (c$, "setLocalName", \r
-function (index, localName) {\r
-if (index >= 0 && index < this.length) {\r
-this.data[index * 5 + 1] = localName;\r
-} else {\r
-this.badIndex (index);\r
-}}, "~N,~S");\r
-Clazz.defineMethod (c$, "setQName", \r
-function (index, qName) {\r
-if (index >= 0 && index < this.length) {\r
-this.data[index * 5 + 2] = qName;\r
-} else {\r
-this.badIndex (index);\r
-}}, "~N,~S");\r
-Clazz.defineMethod (c$, "setType", \r
-function (index, type) {\r
-if (index >= 0 && index < this.length) {\r
-this.data[index * 5 + 3] = type;\r
-} else {\r
-this.badIndex (index);\r
-}}, "~N,~S");\r
-Clazz.defineMethod (c$, "setValue", \r
-function (index, value) {\r
-if (index >= 0 && index < this.length) {\r
-this.data[index * 5 + 4] = value;\r
-} else {\r
-this.badIndex (index);\r
-}}, "~N,~S");\r
-Clazz.defineMethod (c$, "ensureCapacity", \r
- function (n) {\r
-if (n <= 0) {\r
-return;\r
-}var max;\r
-if (this.data == null || this.data.length == 0) {\r
-max = 25;\r
-} else if (this.data.length >= n * 5) {\r
-return;\r
-} else {\r
-max = this.data.length;\r
-}while (max < n * 5) {\r
-max *= 2;\r
-}\r
-var newData =  new Array (max);\r
-if (this.length > 0) {\r
-System.arraycopy (this.data, 0, newData, 0, this.length * 5);\r
-}this.data = newData;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "badIndex", \r
- function (index) {\r
-var msg = "Attempt to modify attribute at illegal index: " + index;\r
-throw  new ArrayIndexOutOfBoundsException (msg);\r
-}, "~N");\r
-});\r
+Clazz.declarePackage ("org.xml.sax.helpers");
+Clazz.load (["org.xml.sax.Attributes"], "org.xml.sax.helpers.AttributesImpl", ["java.lang.ArrayIndexOutOfBoundsException"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.length = 0;
+this.data = null;
+Clazz.instantialize (this, arguments);
+}, org.xml.sax.helpers, "AttributesImpl", null, org.xml.sax.Attributes);
+Clazz.makeConstructor (c$, 
+function () {
+this.length = 0;
+this.data = null;
+});
+Clazz.makeConstructor (c$, 
+function (atts) {
+this.setAttributes (atts);
+}, "org.xml.sax.Attributes");
+Clazz.defineMethod (c$, "getLength", 
+function () {
+return this.length;
+});
+Clazz.defineMethod (c$, "getURI", 
+function (index) {
+if (index >= 0 && index < this.length) {
+return this.data[index * 5];
+} else {
+return null;
+}}, "~N");
+Clazz.defineMethod (c$, "getLocalName", 
+function (index) {
+if (index >= 0 && index < this.length) {
+return this.data[index * 5 + 1];
+} else {
+return null;
+}}, "~N");
+Clazz.defineMethod (c$, "getQName", 
+function (index) {
+if (index >= 0 && index < this.length) {
+return this.data[index * 5 + 2];
+} else {
+return null;
+}}, "~N");
+Clazz.defineMethod (c$, "getType", 
+function (index) {
+if (index >= 0 && index < this.length) {
+return this.data[index * 5 + 3];
+} else {
+return null;
+}}, "~N");
+Clazz.defineMethod (c$, "getValue", 
+function (index) {
+if (index >= 0 && index < this.length) {
+return this.data[index * 5 + 4];
+} else {
+return null;
+}}, "~N");
+Clazz.defineMethod (c$, "getIndex", 
+function (uri, localName) {
+var max = this.length * 5;
+for (var i = 0; i < max; i += 5) {
+if (this.data[i].equals (uri) && this.data[i + 1].equals (localName)) {
+return Clazz.doubleToInt (i / 5);
+}}
+return -1;
+}, "~S,~S");
+Clazz.defineMethod (c$, "getIndex", 
+function (qName) {
+var max = this.length * 5;
+for (var i = 0; i < max; i += 5) {
+if (this.data[i + 2].equals (qName)) {
+return Clazz.doubleToInt (i / 5);
+}}
+return -1;
+}, "~S");
+Clazz.defineMethod (c$, "getType", 
+function (uri, localName) {
+var max = this.length * 5;
+for (var i = 0; i < max; i += 5) {
+if (this.data[i].equals (uri) && this.data[i + 1].equals (localName)) {
+return this.data[i + 3];
+}}
+return null;
+}, "~S,~S");
+Clazz.defineMethod (c$, "getType", 
+function (qName) {
+var max = this.length * 5;
+for (var i = 0; i < max; i += 5) {
+if (this.data[i + 2].equals (qName)) {
+return this.data[i + 3];
+}}
+return null;
+}, "~S");
+Clazz.defineMethod (c$, "getValue", 
+function (uri, localName) {
+var max = this.length * 5;
+for (var i = 0; i < max; i += 5) {
+if (this.data[i].equals (uri) && this.data[i + 1].equals (localName)) {
+return this.data[i + 4];
+}}
+return null;
+}, "~S,~S");
+Clazz.defineMethod (c$, "getValue", 
+function (qName) {
+var max = this.length * 5;
+for (var i = 0; i < max; i += 5) {
+if (this.data[i + 2].equals (qName)) {
+return this.data[i + 4];
+}}
+return null;
+}, "~S");
+Clazz.defineMethod (c$, "clear", 
+function () {
+if (this.data != null) {
+for (var i = 0; i < (this.length * 5); i++) this.data[i] = null;
+
+}this.length = 0;
+});
+Clazz.defineMethod (c$, "setAttributes", 
+function (atts) {
+this.clear ();
+this.length = atts.getLength ();
+if (this.length > 0) {
+this.data =  new Array (this.length * 5);
+for (var i = 0; i < this.length; i++) {
+this.data[i * 5] = atts.getURI (i);
+this.data[i * 5 + 1] = atts.getLocalName (i);
+this.data[i * 5 + 2] = atts.getQName (i);
+this.data[i * 5 + 3] = atts.getType (i);
+this.data[i * 5 + 4] = atts.getValue (i);
+}
+}}, "org.xml.sax.Attributes");
+Clazz.defineMethod (c$, "addAttribute", 
+function (uri, localName, qName, type, value) {
+this.ensureCapacity (this.length + 1);
+this.data[this.length * 5] = uri;
+this.data[this.length * 5 + 1] = localName;
+this.data[this.length * 5 + 2] = qName;
+this.data[this.length * 5 + 3] = type;
+this.data[this.length * 5 + 4] = value;
+this.length++;
+}, "~S,~S,~S,~S,~S");
+Clazz.defineMethod (c$, "setAttribute", 
+function (index, uri, localName, qName, type, value) {
+if (index >= 0 && index < this.length) {
+this.data[index * 5] = uri;
+this.data[index * 5 + 1] = localName;
+this.data[index * 5 + 2] = qName;
+this.data[index * 5 + 3] = type;
+this.data[index * 5 + 4] = value;
+} else {
+this.badIndex (index);
+}}, "~N,~S,~S,~S,~S,~S");
+Clazz.defineMethod (c$, "removeAttribute", 
+function (index) {
+if (index >= 0 && index < this.length) {
+if (index < this.length - 1) {
+System.arraycopy (this.data, (index + 1) * 5, this.data, index * 5, (this.length - index - 1) * 5);
+}index = (this.length - 1) * 5;
+this.data[index++] = null;
+this.data[index++] = null;
+this.data[index++] = null;
+this.data[index++] = null;
+this.data[index] = null;
+this.length--;
+} else {
+this.badIndex (index);
+}}, "~N");
+Clazz.defineMethod (c$, "setURI", 
+function (index, uri) {
+if (index >= 0 && index < this.length) {
+this.data[index * 5] = uri;
+} else {
+this.badIndex (index);
+}}, "~N,~S");
+Clazz.defineMethod (c$, "setLocalName", 
+function (index, localName) {
+if (index >= 0 && index < this.length) {
+this.data[index * 5 + 1] = localName;
+} else {
+this.badIndex (index);
+}}, "~N,~S");
+Clazz.defineMethod (c$, "setQName", 
+function (index, qName) {
+if (index >= 0 && index < this.length) {
+this.data[index * 5 + 2] = qName;
+} else {
+this.badIndex (index);
+}}, "~N,~S");
+Clazz.defineMethod (c$, "setType", 
+function (index, type) {
+if (index >= 0 && index < this.length) {
+this.data[index * 5 + 3] = type;
+} else {
+this.badIndex (index);
+}}, "~N,~S");
+Clazz.defineMethod (c$, "setValue", 
+function (index, value) {
+if (index >= 0 && index < this.length) {
+this.data[index * 5 + 4] = value;
+} else {
+this.badIndex (index);
+}}, "~N,~S");
+Clazz.defineMethod (c$, "ensureCapacity", 
+ function (n) {
+if (n <= 0) {
+return;
+}var max;
+if (this.data == null || this.data.length == 0) {
+max = 25;
+} else if (this.data.length >= n * 5) {
+return;
+} else {
+max = this.data.length;
+}while (max < n * 5) {
+max *= 2;
+}
+var newData =  new Array (max);
+if (this.length > 0) {
+System.arraycopy (this.data, 0, newData, 0, this.length * 5);
+}this.data = newData;
+}, "~N");
+Clazz.defineMethod (c$, "badIndex", 
+ function (index) {
+var msg = "Attempt to modify attribute at illegal index: " + index;
+throw  new ArrayIndexOutOfBoundsException (msg);
+}, "~N");
+});