X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Forg%2Fxml%2Fsax%2Fhelpers%2FAttributeListImpl.js;fp=site%2Fswingjs%2Fj2s%2Forg%2Fxml%2Fsax%2Fhelpers%2FAttributeListImpl.js;h=209bbf9eb2487fcc3e045a98cb2a6ac2bcb22329;hp=10639bac3c9f5c55f0e2260a2c7f1d5902eda64f;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/j2s/org/xml/sax/helpers/AttributeListImpl.js b/site/swingjs/j2s/org/xml/sax/helpers/AttributeListImpl.js index 10639ba..209bbf9 100644 --- a/site/swingjs/j2s/org/xml/sax/helpers/AttributeListImpl.js +++ b/site/swingjs/j2s/org/xml/sax/helpers/AttributeListImpl.js @@ -1,103 +1,103 @@ -Clazz.declarePackage ("org.xml.sax.helpers"); -Clazz.load (["org.xml.sax.AttributeList", "java.util.Vector"], "org.xml.sax.helpers.AttributeListImpl", null, function () { -c$ = Clazz.decorateAsClass (function () { -this.names = null; -this.types = null; -this.values = null; -Clazz.instantialize (this, arguments); -}, org.xml.sax.helpers, "AttributeListImpl", null, org.xml.sax.AttributeList); -Clazz.prepareFields (c$, function () { -this.names = new java.util.Vector (); -this.types = new java.util.Vector (); -this.values = new java.util.Vector (); -}); -Clazz.makeConstructor (c$, -function () { -}); -Clazz.makeConstructor (c$, -function (atts) { -this.setAttributeList (atts); -}, "org.xml.sax.AttributeList"); -Clazz.defineMethod (c$, "setAttributeList", -function (atts) { -var count = atts.getLength (); -this.clear (); -for (var i = 0; i < count; i++) { -this.addAttribute (atts.getName (i), atts.getType (i), atts.getValue (i)); -} -}, "org.xml.sax.AttributeList"); -Clazz.defineMethod (c$, "addAttribute", -function (name, type, value) { -this.names.addElement (name); -this.types.addElement (type); -this.values.addElement (value); -}, "~S,~S,~S"); -Clazz.defineMethod (c$, "removeAttribute", -function (name) { -var i = this.names.indexOf (name); -if (i >= 0) { -this.names.removeElementAt (i); -this.types.removeElementAt (i); -this.values.removeElementAt (i); -}}, "~S"); -Clazz.defineMethod (c$, "clear", -function () { -this.names.removeAllElements (); -this.types.removeAllElements (); -this.values.removeAllElements (); -}); -Clazz.defineMethod (c$, "getLength", -function () { -return this.names.size (); -}); -Clazz.defineMethod (c$, "getName", -function (i) { -if (i < 0) { -return null; -}try { -return this.names.elementAt (i); -} catch (e) { -if (Clazz.exceptionOf (e, ArrayIndexOutOfBoundsException)) { -return null; -} else { -throw e; -} -} -}, "~N"); -Clazz.defineMethod (c$, "getType", -function (i) { -if (i < 0) { -return null; -}try { -return this.types.elementAt (i); -} catch (e) { -if (Clazz.exceptionOf (e, ArrayIndexOutOfBoundsException)) { -return null; -} else { -throw e; -} -} -}, "~N"); -Clazz.defineMethod (c$, "getValue", -function (i) { -if (i < 0) { -return null; -}try { -return this.values.elementAt (i); -} catch (e) { -if (Clazz.exceptionOf (e, ArrayIndexOutOfBoundsException)) { -return null; -} else { -throw e; -} -} -}, "~N"); -Clazz.defineMethod (c$, "getType", -function (name) { -return this.getType (this.names.indexOf (name)); -}, "~S"); -Clazz.defineMethod (c$, "getValue", -function (name) { -return this.getValue (this.names.indexOf (name)); -}, "~S"); -}); +Clazz.declarePackage ("org.xml.sax.helpers"); +Clazz.load (["org.xml.sax.AttributeList", "java.util.Vector"], "org.xml.sax.helpers.AttributeListImpl", null, function () { +c$ = Clazz.decorateAsClass (function () { +this.names = null; +this.types = null; +this.values = null; +Clazz.instantialize (this, arguments); +}, org.xml.sax.helpers, "AttributeListImpl", null, org.xml.sax.AttributeList); +Clazz.prepareFields (c$, function () { +this.names = new java.util.Vector (); +this.types = new java.util.Vector (); +this.values = new java.util.Vector (); +}); +Clazz.makeConstructor (c$, +function () { +}); +Clazz.makeConstructor (c$, +function (atts) { +this.setAttributeList (atts); +}, "org.xml.sax.AttributeList"); +Clazz.defineMethod (c$, "setAttributeList", +function (atts) { +var count = atts.getLength (); +this.clear (); +for (var i = 0; i < count; i++) { +this.addAttribute (atts.getName (i), atts.getType (i), atts.getValue (i)); +} +}, "org.xml.sax.AttributeList"); +Clazz.defineMethod (c$, "addAttribute", +function (name, type, value) { +this.names.addElement (name); +this.types.addElement (type); +this.values.addElement (value); +}, "~S,~S,~S"); +Clazz.defineMethod (c$, "removeAttribute", +function (name) { +var i = this.names.indexOf (name); +if (i >= 0) { +this.names.removeElementAt (i); +this.types.removeElementAt (i); +this.values.removeElementAt (i); +}}, "~S"); +Clazz.defineMethod (c$, "clear", +function () { +this.names.removeAllElements (); +this.types.removeAllElements (); +this.values.removeAllElements (); +}); +Clazz.defineMethod (c$, "getLength", +function () { +return this.names.size (); +}); +Clazz.defineMethod (c$, "getName", +function (i) { +if (i < 0) { +return null; +}try { +return this.names.elementAt (i); +} catch (e) { +if (Clazz.exceptionOf (e, ArrayIndexOutOfBoundsException)) { +return null; +} else { +throw e; +} +} +}, "~N"); +Clazz.defineMethod (c$, "getType", +function (i) { +if (i < 0) { +return null; +}try { +return this.types.elementAt (i); +} catch (e) { +if (Clazz.exceptionOf (e, ArrayIndexOutOfBoundsException)) { +return null; +} else { +throw e; +} +} +}, "~N"); +Clazz.defineMethod (c$, "getValue", +function (i) { +if (i < 0) { +return null; +}try { +return this.values.elementAt (i); +} catch (e) { +if (Clazz.exceptionOf (e, ArrayIndexOutOfBoundsException)) { +return null; +} else { +throw e; +} +} +}, "~N"); +Clazz.defineMethod (c$, "getType", +function (name) { +return this.getType (this.names.indexOf (name)); +}, "~S"); +Clazz.defineMethod (c$, "getValue", +function (name) { +return this.getValue (this.names.indexOf (name)); +}, "~S"); +});