Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / text / AttributedString.js
index 0a49c69..700db8b 100644 (file)
-Clazz.declarePackage ("java.text");\r
-Clazz.load (["java.util.AbstractMap", "$.Map", "java.text.AttributedCharacterIterator"], ["java.text.AttributedString", "$.AttributeEntry"], ["java.lang.IllegalArgumentException", "$.InternalError", "$.NullPointerException", "$.StringBuffer", "$.UnsupportedOperationException", "java.util.HashSet", "$.Hashtable", "$.Vector", "java.text.Annotation"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.text = null;\r
-this.runArraySize = 0;\r
-this.runCount = 0;\r
-this.runStarts = null;\r
-this.runAttributes = null;\r
-this.runAttributeValues = null;\r
-if (!Clazz.isClassDefined ("java.text.AttributedString.AttributedStringIterator")) {\r
-java.text.AttributedString.$AttributedString$AttributedStringIterator$ ();\r
-}\r
-if (!Clazz.isClassDefined ("java.text.AttributedString.AttributeMap")) {\r
-java.text.AttributedString.$AttributedString$AttributeMap$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, java.text, "AttributedString");\r
-Clazz.makeConstructor (c$, \r
-function (iterators) {\r
-if (iterators == null) {\r
-throw  new NullPointerException ("Iterators must not be null");\r
-}if (iterators.length == 0) {\r
-this.text = "";\r
-} else {\r
-var buffer =  new StringBuffer ();\r
-for (var counter = 0; counter < iterators.length; counter++) {\r
-this.appendContents (buffer, iterators[counter]);\r
-}\r
-this.text = buffer.toString ();\r
-if (this.text.length > 0) {\r
-var offset = 0;\r
-var last = null;\r
-for (var counter = 0; counter < iterators.length; counter++) {\r
-var iterator = iterators[counter];\r
-var start = iterator.getBeginIndex ();\r
-var end = iterator.getEndIndex ();\r
-var index = start;\r
-while (index < end) {\r
-iterator.setIndex (index);\r
-var attrs = iterator.getAttributes ();\r
-if (java.text.AttributedString.mapsDiffer (last, attrs)) {\r
-this.setAttributes (attrs, index - start + offset);\r
-}last = attrs;\r
-index = iterator.getRunLimit ();\r
-}\r
-offset += (end - start);\r
-}\r
-}}}, "~A");\r
-Clazz.makeConstructor (c$, \r
-function (text) {\r
-if (text == null) {\r
-throw  new NullPointerException ();\r
-}this.text = text;\r
-}, "~S");\r
-Clazz.makeConstructor (c$, \r
-function (text, attributes) {\r
-if (text == null || attributes == null) {\r
-throw  new NullPointerException ();\r
-}this.text = text;\r
-if (text.length == 0) {\r
-if (attributes.isEmpty ()) return;\r
-throw  new IllegalArgumentException ("Can't add attribute to 0-length text");\r
-}var attributeCount = attributes.size ();\r
-if (attributeCount > 0) {\r
-this.createRunAttributeDataVectors ();\r
-var newRunAttributes =  new java.util.Vector (attributeCount);\r
-var newRunAttributeValues =  new java.util.Vector (attributeCount);\r
-this.runAttributes[0] = newRunAttributes;\r
-this.runAttributeValues[0] = newRunAttributeValues;\r
-var iterator = attributes.entrySet ().iterator ();\r
-while (iterator.hasNext ()) {\r
-var entry = iterator.next ();\r
-newRunAttributes.addElement (entry.getKey ());\r
-newRunAttributeValues.addElement (entry.getValue ());\r
-}\r
-}}, "~S,java.util.Map");\r
-Clazz.makeConstructor (c$, \r
-function (text) {\r
-this.construct (text, text.getBeginIndex (), text.getEndIndex (), null);\r
-}, "java.text.AttributedCharacterIterator");\r
-Clazz.makeConstructor (c$, \r
-function (text, beginIndex, endIndex) {\r
-this.construct (text, beginIndex, endIndex, null);\r
-}, "java.text.AttributedCharacterIterator,~N,~N");\r
-Clazz.makeConstructor (c$, \r
-function (text, beginIndex, endIndex, attributes) {\r
-if (text == null) {\r
-throw  new NullPointerException ();\r
-}var textBeginIndex = text.getBeginIndex ();\r
-var textEndIndex = text.getEndIndex ();\r
-if (beginIndex < textBeginIndex || endIndex > textEndIndex || beginIndex > endIndex) throw  new IllegalArgumentException ("Invalid substring range");\r
-var textBuffer =  new StringBuffer ();\r
-text.setIndex (beginIndex);\r
-for (var c = text.current (); text.getIndex () < endIndex; c = text.next ()) textBuffer.append (c);\r
-\r
-this.text = textBuffer.toString ();\r
-if (beginIndex == endIndex) return;\r
-var keys =  new java.util.HashSet ();\r
-if (attributes == null) {\r
-keys.addAll (text.getAllAttributeKeys ());\r
-} else {\r
-for (var i = 0; i < attributes.length; i++) keys.add (attributes[i]);\r
-\r
-keys.retainAll (text.getAllAttributeKeys ());\r
-}if (keys.isEmpty ()) return;\r
-var itr = keys.iterator ();\r
-while (itr.hasNext ()) {\r
-var attributeKey = itr.next ();\r
-text.setIndex (textBeginIndex);\r
-while (text.getIndex () < endIndex) {\r
-var start = text.getRunStart (attributeKey);\r
-var limit = text.getRunLimit (attributeKey);\r
-var value = text.getAttribute (attributeKey);\r
-if (value != null) {\r
-if (Clazz.instanceOf (value, java.text.Annotation)) {\r
-if (start >= beginIndex && limit <= endIndex) {\r
-this.addAttribute (attributeKey, value, start - beginIndex, limit - beginIndex);\r
-} else {\r
-if (limit > endIndex) break;\r
-}} else {\r
-if (start >= endIndex) break;\r
-if (limit > beginIndex) {\r
-if (start < beginIndex) start = beginIndex;\r
-if (limit > endIndex) limit = endIndex;\r
-if (start != limit) {\r
-this.addAttribute (attributeKey, value, start - beginIndex, limit - beginIndex);\r
-}}}}text.setIndex (limit);\r
-}\r
-}\r
-}, "java.text.AttributedCharacterIterator,~N,~N,~A");\r
-Clazz.defineMethod (c$, "addAttribute", \r
-function (attribute, value) {\r
-if (attribute == null) {\r
-throw  new NullPointerException ();\r
-}var len = this.length ();\r
-if (len == 0) {\r
-throw  new IllegalArgumentException ("Can't add attribute to 0-length text");\r
-}this.addAttributeImpl (attribute, value, 0, len);\r
-}, "java.text.AttributedCharacterIterator.Attribute,~O");\r
-Clazz.defineMethod (c$, "addAttribute", \r
-function (attribute, value, beginIndex, endIndex) {\r
-if (attribute == null) {\r
-throw  new NullPointerException ();\r
-}if (beginIndex < 0 || endIndex > this.length () || beginIndex >= endIndex) {\r
-throw  new IllegalArgumentException ("Invalid substring range");\r
-}this.addAttributeImpl (attribute, value, beginIndex, endIndex);\r
-}, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");\r
-Clazz.defineMethod (c$, "addAttributes", \r
-function (attributes, beginIndex, endIndex) {\r
-if (attributes == null) {\r
-throw  new NullPointerException ();\r
-}if (beginIndex < 0 || endIndex > this.length () || beginIndex > endIndex) {\r
-throw  new IllegalArgumentException ("Invalid substring range");\r
-}if (beginIndex == endIndex) {\r
-if (attributes.isEmpty ()) return;\r
-throw  new IllegalArgumentException ("Can't add attribute to 0-length text");\r
-}if (this.runCount == 0) {\r
-this.createRunAttributeDataVectors ();\r
-}var beginRunIndex = this.ensureRunBreak (beginIndex);\r
-var endRunIndex = this.ensureRunBreak (endIndex);\r
-var iterator = attributes.entrySet ().iterator ();\r
-while (iterator.hasNext ()) {\r
-var entry = iterator.next ();\r
-this.addAttributeRunData (entry.getKey (), entry.getValue (), beginRunIndex, endRunIndex);\r
-}\r
-}, "java.util.Map,~N,~N");\r
-Clazz.defineMethod (c$, "addAttributeImpl", \r
- function (attribute, value, beginIndex, endIndex) {\r
-if (this.runCount == 0) {\r
-this.createRunAttributeDataVectors ();\r
-}var beginRunIndex = this.ensureRunBreak (beginIndex);\r
-var endRunIndex = this.ensureRunBreak (endIndex);\r
-this.addAttributeRunData (attribute, value, beginRunIndex, endRunIndex);\r
-}, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");\r
-Clazz.defineMethod (c$, "createRunAttributeDataVectors", \r
- function () {\r
-var newRunStarts =  Clazz.newIntArray (10, 0);\r
-var newRunAttributes =  new Array (10);\r
-var newRunAttributeValues =  new Array (10);\r
-this.runStarts = newRunStarts;\r
-this.runAttributes = newRunAttributes;\r
-this.runAttributeValues = newRunAttributeValues;\r
-this.runArraySize = 10;\r
-this.runCount = 1;\r
-});\r
-Clazz.defineMethod (c$, "ensureRunBreak", \r
- function (offset) {\r
-return this.ensureRunBreak (offset, true);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "ensureRunBreak", \r
- function (offset, copyAttrs) {\r
-if (offset == this.length ()) {\r
-return this.runCount;\r
-}var runIndex = 0;\r
-while (runIndex < this.runCount && this.runStarts[runIndex] < offset) {\r
-runIndex++;\r
-}\r
-if (runIndex < this.runCount && this.runStarts[runIndex] == offset) {\r
-return runIndex;\r
-}if (this.runCount == this.runArraySize) {\r
-var newArraySize = this.runArraySize + 10;\r
-var newRunStarts =  Clazz.newIntArray (newArraySize, 0);\r
-var newRunAttributes =  new Array (newArraySize);\r
-var newRunAttributeValues =  new Array (newArraySize);\r
-for (var i = 0; i < this.runArraySize; i++) {\r
-newRunStarts[i] = this.runStarts[i];\r
-newRunAttributes[i] = this.runAttributes[i];\r
-newRunAttributeValues[i] = this.runAttributeValues[i];\r
-}\r
-this.runStarts = newRunStarts;\r
-this.runAttributes = newRunAttributes;\r
-this.runAttributeValues = newRunAttributeValues;\r
-this.runArraySize = newArraySize;\r
-}var newRunAttributes = null;\r
-var newRunAttributeValues = null;\r
-if (copyAttrs) {\r
-var oldRunAttributes = this.runAttributes[runIndex - 1];\r
-var oldRunAttributeValues = this.runAttributeValues[runIndex - 1];\r
-if (oldRunAttributes != null) {\r
-newRunAttributes = oldRunAttributes.clone ();\r
-}if (oldRunAttributeValues != null) {\r
-newRunAttributeValues = oldRunAttributeValues.clone ();\r
-}}this.runCount++;\r
-for (var i = this.runCount - 1; i > runIndex; i--) {\r
-this.runStarts[i] = this.runStarts[i - 1];\r
-this.runAttributes[i] = this.runAttributes[i - 1];\r
-this.runAttributeValues[i] = this.runAttributeValues[i - 1];\r
-}\r
-this.runStarts[runIndex] = offset;\r
-this.runAttributes[runIndex] = newRunAttributes;\r
-this.runAttributeValues[runIndex] = newRunAttributeValues;\r
-return runIndex;\r
-}, "~N,~B");\r
-Clazz.defineMethod (c$, "addAttributeRunData", \r
- function (attribute, value, beginRunIndex, endRunIndex) {\r
-for (var i = beginRunIndex; i < endRunIndex; i++) {\r
-var keyValueIndex = -1;\r
-if (this.runAttributes[i] == null) {\r
-var newRunAttributes =  new java.util.Vector ();\r
-var newRunAttributeValues =  new java.util.Vector ();\r
-this.runAttributes[i] = newRunAttributes;\r
-this.runAttributeValues[i] = newRunAttributeValues;\r
-} else {\r
-keyValueIndex = this.runAttributes[i].indexOf (attribute);\r
-}if (keyValueIndex == -1) {\r
-var oldSize = this.runAttributes[i].size ();\r
-this.runAttributes[i].addElement (attribute);\r
-try {\r
-this.runAttributeValues[i].addElement (value);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, Exception)) {\r
-this.runAttributes[i].setSize (oldSize);\r
-this.runAttributeValues[i].setSize (oldSize);\r
-} else {\r
-throw e;\r
-}\r
-}\r
-} else {\r
-this.runAttributeValues[i].set (keyValueIndex, value);\r
-}}\r
-}, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");\r
-Clazz.defineMethod (c$, "getIterator", \r
-function () {\r
-return this.getIterator (null, 0, this.length ());\r
-});\r
-Clazz.defineMethod (c$, "getIterator", \r
-function (attributes) {\r
-return this.getIterator (attributes, 0, this.length ());\r
-}, "~A");\r
-Clazz.defineMethod (c$, "getIterator", \r
-function (attributes, beginIndex, endIndex) {\r
-return Clazz.innerTypeInstance (java.text.AttributedString.AttributedStringIterator, this, null, attributes, beginIndex, endIndex);\r
-}, "~A,~N,~N");\r
-Clazz.defineMethod (c$, "length", \r
-function () {\r
-return this.text.length;\r
-});\r
-Clazz.defineMethod (c$, "charAt", \r
- function (index) {\r
-return this.text.charAt (index);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getAttribute", \r
- function (attribute, runIndex) {\r
-var currentRunAttributes = this.runAttributes[runIndex];\r
-var currentRunAttributeValues = this.runAttributeValues[runIndex];\r
-if (currentRunAttributes == null) {\r
-return null;\r
-}var attributeIndex = currentRunAttributes.indexOf (attribute);\r
-if (attributeIndex != -1) {\r
-return currentRunAttributeValues.elementAt (attributeIndex);\r
-} else {\r
-return null;\r
-}}, "java.text.AttributedCharacterIterator.Attribute,~N");\r
-Clazz.defineMethod (c$, "getAttributeCheckRange", \r
- function (attribute, runIndex, beginIndex, endIndex) {\r
-var value = this.getAttribute (attribute, runIndex);\r
-if (Clazz.instanceOf (value, java.text.Annotation)) {\r
-if (beginIndex > 0) {\r
-var currIndex = runIndex;\r
-var runStart = this.runStarts[currIndex];\r
-while (runStart >= beginIndex && java.text.AttributedString.valuesMatch (value, this.getAttribute (attribute, currIndex - 1))) {\r
-currIndex--;\r
-runStart = this.runStarts[currIndex];\r
-}\r
-if (runStart < beginIndex) {\r
-return null;\r
-}}var textLength = this.length ();\r
-if (endIndex < textLength) {\r
-var currIndex = runIndex;\r
-var runLimit = (currIndex < this.runCount - 1) ? this.runStarts[currIndex + 1] : textLength;\r
-while (runLimit <= endIndex && java.text.AttributedString.valuesMatch (value, this.getAttribute (attribute, currIndex + 1))) {\r
-currIndex++;\r
-runLimit = (currIndex < this.runCount - 1) ? this.runStarts[currIndex + 1] : textLength;\r
-}\r
-if (runLimit > endIndex) {\r
-return null;\r
-}}}return value;\r
-}, "java.text.AttributedCharacterIterator.Attribute,~N,~N,~N");\r
-Clazz.defineMethod (c$, "attributeValuesMatch", \r
- function (attributes, runIndex1, runIndex2) {\r
-var iterator = attributes.iterator ();\r
-while (iterator.hasNext ()) {\r
-var key = iterator.next ();\r
-if (!java.text.AttributedString.valuesMatch (this.getAttribute (key, runIndex1), this.getAttribute (key, runIndex2))) {\r
-return false;\r
-}}\r
-return true;\r
-}, "java.util.Set,~N,~N");\r
-c$.valuesMatch = Clazz.defineMethod (c$, "valuesMatch", \r
- function (value1, value2) {\r
-if (value1 == null) {\r
-return value2 == null;\r
-} else {\r
-return value1.equals (value2);\r
-}}, "~O,~O");\r
-Clazz.defineMethod (c$, "appendContents", \r
- function (buf, iterator) {\r
-var index = iterator.getBeginIndex ();\r
-var end = iterator.getEndIndex ();\r
-while (index < end) {\r
-iterator.setIndex (index++);\r
-buf.append (iterator.current ());\r
-}\r
-}, "StringBuffer,java.text.CharacterIterator");\r
-Clazz.defineMethod (c$, "setAttributes", \r
- function (attrs, offset) {\r
-if (this.runCount == 0) {\r
-this.createRunAttributeDataVectors ();\r
-}var index = this.ensureRunBreak (offset, false);\r
-var size;\r
-if (attrs != null && (size = attrs.size ()) > 0) {\r
-var runAttrs =  new java.util.Vector (size);\r
-var runValues =  new java.util.Vector (size);\r
-var iterator = attrs.entrySet ().iterator ();\r
-while (iterator.hasNext ()) {\r
-var entry = iterator.next ();\r
-runAttrs.add (entry.getKey ());\r
-runValues.add (entry.getValue ());\r
-}\r
-this.runAttributes[index] = runAttrs;\r
-this.runAttributeValues[index] = runValues;\r
-}}, "java.util.Map,~N");\r
-c$.mapsDiffer = Clazz.defineMethod (c$, "mapsDiffer", \r
- function (last, attrs) {\r
-if (last == null) {\r
-return (attrs != null && attrs.size () > 0);\r
-}return (!last.equals (attrs));\r
-}, "java.util.Map,java.util.Map");\r
-c$.$AttributedString$AttributedStringIterator$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.beginIndex = 0;\r
-this.endIndex = 0;\r
-this.currentIndex = 0;\r
-this.currentRunIndex = 0;\r
-this.currentRunStart = 0;\r
-this.currentRunLimit = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, java.text.AttributedString, "AttributedStringIterator", null, java.text.AttributedCharacterIterator);\r
-Clazz.makeConstructor (c$, \r
-function (a, b, c) {\r
-if (b < 0 || b > c || c > this.b$["java.text.AttributedString"].length ()) {\r
-throw  new IllegalArgumentException ("Invalid substring range");\r
-}this.beginIndex = b;\r
-this.endIndex = c;\r
-this.currentIndex = b;\r
-this.updateRunInfo ();\r
-}, "~A,~N,~N");\r
-Clazz.overrideMethod (c$, "equals", \r
-function (a) {\r
-if (this === a) {\r
-return true;\r
-}if (!(Clazz.instanceOf (a, java.text.AttributedString.AttributedStringIterator))) {\r
-return false;\r
-}var b = a;\r
-if (this.b$["java.text.AttributedString"] !== b.getString ()) return false;\r
-if (this.currentIndex != b.currentIndex || this.beginIndex != b.beginIndex || this.endIndex != b.endIndex) return false;\r
-return true;\r
-}, "~O");\r
-Clazz.overrideMethod (c$, "hashCode", \r
-function () {\r
-return this.b$["java.text.AttributedString"].text.hashCode () ^ this.currentIndex ^ this.beginIndex ^ this.endIndex;\r
-});\r
-Clazz.overrideMethod (c$, "clone", \r
-function () {\r
-try {\r
-var a = Clazz.superCall (this, java.text.AttributedString.AttributedStringIterator, "clone", []);\r
-return a;\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, CloneNotSupportedException)) {\r
-throw  new InternalError ();\r
-} else {\r
-throw e;\r
-}\r
-}\r
-});\r
-Clazz.overrideMethod (c$, "first", \r
-function () {\r
-return this.internalSetIndex (this.beginIndex);\r
-});\r
-Clazz.overrideMethod (c$, "last", \r
-function () {\r
-if (this.endIndex == this.beginIndex) {\r
-return this.internalSetIndex (this.endIndex);\r
-} else {\r
-return this.internalSetIndex (this.endIndex - 1);\r
-}});\r
-Clazz.overrideMethod (c$, "current", \r
-function () {\r
-if (this.currentIndex == this.endIndex) {\r
-return '\uffff';\r
-} else {\r
-return this.b$["java.text.AttributedString"].charAt (this.currentIndex);\r
-}});\r
-Clazz.overrideMethod (c$, "next", \r
-function () {\r
-if (this.currentIndex < this.endIndex) {\r
-return this.internalSetIndex (this.currentIndex + 1);\r
-} else {\r
-return '\uffff';\r
-}});\r
-Clazz.overrideMethod (c$, "previous", \r
-function () {\r
-if (this.currentIndex > this.beginIndex) {\r
-return this.internalSetIndex (this.currentIndex - 1);\r
-} else {\r
-return '\uffff';\r
-}});\r
-Clazz.overrideMethod (c$, "setIndex", \r
-function (a) {\r
-if (a < this.beginIndex || a > this.endIndex) throw  new IllegalArgumentException ("Invalid index");\r
-return this.internalSetIndex (a);\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "getBeginIndex", \r
-function () {\r
-return this.beginIndex;\r
-});\r
-Clazz.overrideMethod (c$, "getEndIndex", \r
-function () {\r
-return this.endIndex;\r
-});\r
-Clazz.overrideMethod (c$, "getIndex", \r
-function () {\r
-return this.currentIndex;\r
-});\r
-Clazz.defineMethod (c$, "getRunStart", \r
-function () {\r
-return this.currentRunStart;\r
-});\r
-Clazz.defineMethod (c$, "getRunStart", \r
-function (a) {\r
-if (this.currentRunStart == this.beginIndex || this.currentRunIndex == -1) {\r
-return this.currentRunStart;\r
-} else {\r
-var b = this.getAttribute (a);\r
-var c = this.currentRunStart;\r
-var d = this.currentRunIndex;\r
-while (c > this.beginIndex && java.text.AttributedString.valuesMatch (b, this.b$["java.text.AttributedString"].getAttribute (a, d - 1))) {\r
-d--;\r
-c = this.b$["java.text.AttributedString"].runStarts[d];\r
-}\r
-if (c < this.beginIndex) {\r
-c = this.beginIndex;\r
-}return c;\r
-}}, "java.text.AttributedCharacterIterator.Attribute");\r
-Clazz.defineMethod (c$, "getRunStart", \r
-function (a) {\r
-if (this.currentRunStart == this.beginIndex || this.currentRunIndex == -1) {\r
-return this.currentRunStart;\r
-} else {\r
-var b = this.currentRunStart;\r
-var c = this.currentRunIndex;\r
-while (b > this.beginIndex && this.b$["java.text.AttributedString"].attributeValuesMatch (a, this.currentRunIndex, c - 1)) {\r
-c--;\r
-b = this.b$["java.text.AttributedString"].runStarts[c];\r
-}\r
-if (b < this.beginIndex) {\r
-b = this.beginIndex;\r
-}return b;\r
-}}, "java.util.Set");\r
-Clazz.defineMethod (c$, "getRunLimit", \r
-function () {\r
-return this.currentRunLimit;\r
-});\r
-Clazz.defineMethod (c$, "getRunLimit", \r
-function (a) {\r
-if (this.currentRunLimit == this.endIndex || this.currentRunIndex == -1) {\r
-return this.currentRunLimit;\r
-} else {\r
-var b = this.getAttribute (a);\r
-var c = this.currentRunLimit;\r
-var d = this.currentRunIndex;\r
-while (c < this.endIndex && java.text.AttributedString.valuesMatch (b, this.b$["java.text.AttributedString"].getAttribute (a, d + 1))) {\r
-d++;\r
-c = d < this.b$["java.text.AttributedString"].runCount - 1 ? this.b$["java.text.AttributedString"].runStarts[d + 1] : this.endIndex;\r
-}\r
-if (c > this.endIndex) {\r
-c = this.endIndex;\r
-}return c;\r
-}}, "java.text.AttributedCharacterIterator.Attribute");\r
-Clazz.defineMethod (c$, "getRunLimit", \r
-function (a) {\r
-if (this.currentRunLimit == this.endIndex || this.currentRunIndex == -1) {\r
-return this.currentRunLimit;\r
-} else {\r
-var b = this.currentRunLimit;\r
-var c = this.currentRunIndex;\r
-while (b < this.endIndex && this.b$["java.text.AttributedString"].attributeValuesMatch (a, this.currentRunIndex, c + 1)) {\r
-c++;\r
-b = c < this.b$["java.text.AttributedString"].runCount - 1 ? this.b$["java.text.AttributedString"].runStarts[c + 1] : this.endIndex;\r
-}\r
-if (b > this.endIndex) {\r
-b = this.endIndex;\r
-}return b;\r
-}}, "java.util.Set");\r
-Clazz.overrideMethod (c$, "getAttributes", \r
-function () {\r
-if (this.b$["java.text.AttributedString"].runAttributes == null || this.currentRunIndex == -1 || this.b$["java.text.AttributedString"].runAttributes[this.currentRunIndex] == null) {\r
-return  new java.util.Hashtable ();\r
-}return Clazz.innerTypeInstance (java.text.AttributedString.AttributeMap, this, null, this.currentRunIndex, this.beginIndex, this.endIndex);\r
-});\r
-Clazz.overrideMethod (c$, "getAllAttributeKeys", \r
-function () {\r
-if (this.b$["java.text.AttributedString"].runAttributes == null) {\r
-return  new java.util.HashSet ();\r
-}{\r
-var a =  new java.util.HashSet ();\r
-var b = 0;\r
-while (b < this.b$["java.text.AttributedString"].runCount) {\r
-if (this.b$["java.text.AttributedString"].runStarts[b] < this.endIndex && (b == this.b$["java.text.AttributedString"].runCount - 1 || this.b$["java.text.AttributedString"].runStarts[b + 1] > this.beginIndex)) {\r
-var c = this.b$["java.text.AttributedString"].runAttributes[b];\r
-if (c != null) {\r
-var d = c.size ();\r
-while (d-- > 0) {\r
-a.add (c.get (d));\r
-}\r
-}}b++;\r
-}\r
-return a;\r
-}});\r
-Clazz.overrideMethod (c$, "getAttribute", \r
-function (a) {\r
-var b = this.currentRunIndex;\r
-if (b < 0) {\r
-return null;\r
-}return this.b$["java.text.AttributedString"].getAttributeCheckRange (a, b, this.beginIndex, this.endIndex);\r
-}, "java.text.AttributedCharacterIterator.Attribute");\r
-Clazz.defineMethod (c$, "getString", \r
- function () {\r
-return this.b$["java.text.AttributedString"];\r
-});\r
-Clazz.defineMethod (c$, "internalSetIndex", \r
- function (a) {\r
-this.currentIndex = a;\r
-if (a < this.currentRunStart || a >= this.currentRunLimit) {\r
-this.updateRunInfo ();\r
-}if (this.currentIndex == this.endIndex) {\r
-return '\uffff';\r
-} else {\r
-return this.b$["java.text.AttributedString"].charAt (a);\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "updateRunInfo", \r
- function () {\r
-if (this.currentIndex == this.endIndex) {\r
-this.currentRunStart = this.currentRunLimit = this.endIndex;\r
-this.currentRunIndex = -1;\r
-} else {\r
-{\r
-var a = -1;\r
-while (a < this.b$["java.text.AttributedString"].runCount - 1 && this.b$["java.text.AttributedString"].runStarts[a + 1] <= this.currentIndex) a++;\r
-\r
-this.currentRunIndex = a;\r
-if (a >= 0) {\r
-this.currentRunStart = this.b$["java.text.AttributedString"].runStarts[a];\r
-if (this.currentRunStart < this.beginIndex) this.currentRunStart = this.beginIndex;\r
-} else {\r
-this.currentRunStart = this.beginIndex;\r
-}if (a < this.b$["java.text.AttributedString"].runCount - 1) {\r
-this.currentRunLimit = this.b$["java.text.AttributedString"].runStarts[a + 1];\r
-if (this.currentRunLimit > this.endIndex) this.currentRunLimit = this.endIndex;\r
-} else {\r
-this.currentRunLimit = this.endIndex;\r
-}}}});\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$AttributedString$AttributeMap$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.runIndex = 0;\r
-this.beginIndex = 0;\r
-this.endIndex = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, java.text.AttributedString, "AttributeMap", java.util.AbstractMap);\r
-Clazz.makeConstructor (c$, \r
-function (a, b, c) {\r
-Clazz.superConstructor (this, java.text.AttributedString.AttributeMap, []);\r
-this.runIndex = a;\r
-this.beginIndex = b;\r
-this.endIndex = c;\r
-}, "~N,~N,~N");\r
-Clazz.overrideMethod (c$, "entrySet", \r
-function () {\r
-var a =  new java.util.HashSet ();\r
-{\r
-var b = this.b$["java.text.AttributedString"].runAttributes[this.runIndex].size ();\r
-for (var c = 0; c < b; c++) {\r
-var d = this.b$["java.text.AttributedString"].runAttributes[this.runIndex].get (c);\r
-var e = this.b$["java.text.AttributedString"].runAttributeValues[this.runIndex].get (c);\r
-if (Clazz.instanceOf (e, java.text.Annotation)) {\r
-e = this.b$["java.text.AttributedString"].getAttributeCheckRange (d, this.runIndex, this.beginIndex, this.endIndex);\r
-if (e == null) {\r
-continue;\r
-}}var f =  new java.text.AttributeEntry (d, e);\r
-a.add (f);\r
-}\r
-}return a;\r
-});\r
-Clazz.overrideMethod (c$, "get", \r
-function (a) {\r
-return this.b$["java.text.AttributedString"].getAttributeCheckRange (a, this.runIndex, this.beginIndex, this.endIndex);\r
-}, "~O");\r
-c$ = Clazz.p0p ();\r
-};\r
-Clazz.defineStatics (c$,\r
-"ARRAY_SIZE_INCREMENT", 10);\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.key = null;\r
-this.value = null;\r
-Clazz.instantialize (this, arguments);\r
-}, java.text, "AttributeEntry", null, java.util.Map.Entry);\r
-Clazz.makeConstructor (c$, \r
-function (key, value) {\r
-this.key = key;\r
-this.value = value;\r
-}, "java.text.AttributedCharacterIterator.Attribute,~O");\r
-Clazz.overrideMethod (c$, "equals", \r
-function (o) {\r
-if (!(Clazz.instanceOf (o, java.text.AttributeEntry))) {\r
-return false;\r
-}var other = o;\r
-return other.key.equals (this.key) && (this.value == null ? other.value == null : other.value.equals (this.value));\r
-}, "~O");\r
-Clazz.overrideMethod (c$, "getKey", \r
-function () {\r
-return this.key;\r
-});\r
-Clazz.overrideMethod (c$, "getValue", \r
-function () {\r
-return this.value;\r
-});\r
-Clazz.overrideMethod (c$, "setValue", \r
-function (newValue) {\r
-throw  new UnsupportedOperationException ();\r
-}, "~O");\r
-Clazz.overrideMethod (c$, "hashCode", \r
-function () {\r
-return this.key.hashCode () ^ (this.value == null ? 0 : this.value.hashCode ());\r
-});\r
-Clazz.defineMethod (c$, "toString", \r
-function () {\r
-return this.key.toString () + "=" + this.value.toString ();\r
-});\r
-});\r
+Clazz.declarePackage ("java.text");
+Clazz.load (["java.util.AbstractMap", "$.Map", "java.text.AttributedCharacterIterator"], ["java.text.AttributedString", "$.AttributeEntry"], ["java.lang.IllegalArgumentException", "$.InternalError", "$.NullPointerException", "$.StringBuffer", "$.UnsupportedOperationException", "java.util.HashSet", "$.Hashtable", "$.Vector", "java.text.Annotation"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.text = null;
+this.runArraySize = 0;
+this.runCount = 0;
+this.runStarts = null;
+this.runAttributes = null;
+this.runAttributeValues = null;
+if (!Clazz.isClassDefined ("java.text.AttributedString.AttributedStringIterator")) {
+java.text.AttributedString.$AttributedString$AttributedStringIterator$ ();
+}
+if (!Clazz.isClassDefined ("java.text.AttributedString.AttributeMap")) {
+java.text.AttributedString.$AttributedString$AttributeMap$ ();
+}
+Clazz.instantialize (this, arguments);
+}, java.text, "AttributedString");
+Clazz.makeConstructor (c$, 
+function (iterators) {
+if (iterators == null) {
+throw  new NullPointerException ("Iterators must not be null");
+}if (iterators.length == 0) {
+this.text = "";
+} else {
+var buffer =  new StringBuffer ();
+for (var counter = 0; counter < iterators.length; counter++) {
+this.appendContents (buffer, iterators[counter]);
+}
+this.text = buffer.toString ();
+if (this.text.length > 0) {
+var offset = 0;
+var last = null;
+for (var counter = 0; counter < iterators.length; counter++) {
+var iterator = iterators[counter];
+var start = iterator.getBeginIndex ();
+var end = iterator.getEndIndex ();
+var index = start;
+while (index < end) {
+iterator.setIndex (index);
+var attrs = iterator.getAttributes ();
+if (java.text.AttributedString.mapsDiffer (last, attrs)) {
+this.setAttributes (attrs, index - start + offset);
+}last = attrs;
+index = iterator.getRunLimit ();
+}
+offset += (end - start);
+}
+}}}, "~A");
+Clazz.makeConstructor (c$, 
+function (text) {
+if (text == null) {
+throw  new NullPointerException ();
+}this.text = text;
+}, "~S");
+Clazz.makeConstructor (c$, 
+function (text, attributes) {
+if (text == null || attributes == null) {
+throw  new NullPointerException ();
+}this.text = text;
+if (text.length == 0) {
+if (attributes.isEmpty ()) return;
+throw  new IllegalArgumentException ("Can't add attribute to 0-length text");
+}var attributeCount = attributes.size ();
+if (attributeCount > 0) {
+this.createRunAttributeDataVectors ();
+var newRunAttributes =  new java.util.Vector (attributeCount);
+var newRunAttributeValues =  new java.util.Vector (attributeCount);
+this.runAttributes[0] = newRunAttributes;
+this.runAttributeValues[0] = newRunAttributeValues;
+var iterator = attributes.entrySet ().iterator ();
+while (iterator.hasNext ()) {
+var entry = iterator.next ();
+newRunAttributes.addElement (entry.getKey ());
+newRunAttributeValues.addElement (entry.getValue ());
+}
+}}, "~S,java.util.Map");
+Clazz.makeConstructor (c$, 
+function (text) {
+this.construct (text, text.getBeginIndex (), text.getEndIndex (), null);
+}, "java.text.AttributedCharacterIterator");
+Clazz.makeConstructor (c$, 
+function (text, beginIndex, endIndex) {
+this.construct (text, beginIndex, endIndex, null);
+}, "java.text.AttributedCharacterIterator,~N,~N");
+Clazz.makeConstructor (c$, 
+function (text, beginIndex, endIndex, attributes) {
+if (text == null) {
+throw  new NullPointerException ();
+}var textBeginIndex = text.getBeginIndex ();
+var textEndIndex = text.getEndIndex ();
+if (beginIndex < textBeginIndex || endIndex > textEndIndex || beginIndex > endIndex) throw  new IllegalArgumentException ("Invalid substring range");
+var textBuffer =  new StringBuffer ();
+text.setIndex (beginIndex);
+for (var c = text.current (); text.getIndex () < endIndex; c = text.next ()) textBuffer.append (c);
+
+this.text = textBuffer.toString ();
+if (beginIndex == endIndex) return;
+var keys =  new java.util.HashSet ();
+if (attributes == null) {
+keys.addAll (text.getAllAttributeKeys ());
+} else {
+for (var i = 0; i < attributes.length; i++) keys.add (attributes[i]);
+
+keys.retainAll (text.getAllAttributeKeys ());
+}if (keys.isEmpty ()) return;
+var itr = keys.iterator ();
+while (itr.hasNext ()) {
+var attributeKey = itr.next ();
+text.setIndex (textBeginIndex);
+while (text.getIndex () < endIndex) {
+var start = text.getRunStart (attributeKey);
+var limit = text.getRunLimit (attributeKey);
+var value = text.getAttribute (attributeKey);
+if (value != null) {
+if (Clazz.instanceOf (value, java.text.Annotation)) {
+if (start >= beginIndex && limit <= endIndex) {
+this.addAttribute (attributeKey, value, start - beginIndex, limit - beginIndex);
+} else {
+if (limit > endIndex) break;
+}} else {
+if (start >= endIndex) break;
+if (limit > beginIndex) {
+if (start < beginIndex) start = beginIndex;
+if (limit > endIndex) limit = endIndex;
+if (start != limit) {
+this.addAttribute (attributeKey, value, start - beginIndex, limit - beginIndex);
+}}}}text.setIndex (limit);
+}
+}
+}, "java.text.AttributedCharacterIterator,~N,~N,~A");
+Clazz.defineMethod (c$, "addAttribute", 
+function (attribute, value) {
+if (attribute == null) {
+throw  new NullPointerException ();
+}var len = this.length ();
+if (len == 0) {
+throw  new IllegalArgumentException ("Can't add attribute to 0-length text");
+}this.addAttributeImpl (attribute, value, 0, len);
+}, "java.text.AttributedCharacterIterator.Attribute,~O");
+Clazz.defineMethod (c$, "addAttribute", 
+function (attribute, value, beginIndex, endIndex) {
+if (attribute == null) {
+throw  new NullPointerException ();
+}if (beginIndex < 0 || endIndex > this.length () || beginIndex >= endIndex) {
+throw  new IllegalArgumentException ("Invalid substring range");
+}this.addAttributeImpl (attribute, value, beginIndex, endIndex);
+}, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");
+Clazz.defineMethod (c$, "addAttributes", 
+function (attributes, beginIndex, endIndex) {
+if (attributes == null) {
+throw  new NullPointerException ();
+}if (beginIndex < 0 || endIndex > this.length () || beginIndex > endIndex) {
+throw  new IllegalArgumentException ("Invalid substring range");
+}if (beginIndex == endIndex) {
+if (attributes.isEmpty ()) return;
+throw  new IllegalArgumentException ("Can't add attribute to 0-length text");
+}if (this.runCount == 0) {
+this.createRunAttributeDataVectors ();
+}var beginRunIndex = this.ensureRunBreak (beginIndex);
+var endRunIndex = this.ensureRunBreak (endIndex);
+var iterator = attributes.entrySet ().iterator ();
+while (iterator.hasNext ()) {
+var entry = iterator.next ();
+this.addAttributeRunData (entry.getKey (), entry.getValue (), beginRunIndex, endRunIndex);
+}
+}, "java.util.Map,~N,~N");
+Clazz.defineMethod (c$, "addAttributeImpl", 
+ function (attribute, value, beginIndex, endIndex) {
+if (this.runCount == 0) {
+this.createRunAttributeDataVectors ();
+}var beginRunIndex = this.ensureRunBreak (beginIndex);
+var endRunIndex = this.ensureRunBreak (endIndex);
+this.addAttributeRunData (attribute, value, beginRunIndex, endRunIndex);
+}, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");
+Clazz.defineMethod (c$, "createRunAttributeDataVectors", 
+ function () {
+var newRunStarts =  Clazz.newIntArray (10, 0);
+var newRunAttributes =  new Array (10);
+var newRunAttributeValues =  new Array (10);
+this.runStarts = newRunStarts;
+this.runAttributes = newRunAttributes;
+this.runAttributeValues = newRunAttributeValues;
+this.runArraySize = 10;
+this.runCount = 1;
+});
+Clazz.defineMethod (c$, "ensureRunBreak", 
+ function (offset) {
+return this.ensureRunBreak (offset, true);
+}, "~N");
+Clazz.defineMethod (c$, "ensureRunBreak", 
+ function (offset, copyAttrs) {
+if (offset == this.length ()) {
+return this.runCount;
+}var runIndex = 0;
+while (runIndex < this.runCount && this.runStarts[runIndex] < offset) {
+runIndex++;
+}
+if (runIndex < this.runCount && this.runStarts[runIndex] == offset) {
+return runIndex;
+}if (this.runCount == this.runArraySize) {
+var newArraySize = this.runArraySize + 10;
+var newRunStarts =  Clazz.newIntArray (newArraySize, 0);
+var newRunAttributes =  new Array (newArraySize);
+var newRunAttributeValues =  new Array (newArraySize);
+for (var i = 0; i < this.runArraySize; i++) {
+newRunStarts[i] = this.runStarts[i];
+newRunAttributes[i] = this.runAttributes[i];
+newRunAttributeValues[i] = this.runAttributeValues[i];
+}
+this.runStarts = newRunStarts;
+this.runAttributes = newRunAttributes;
+this.runAttributeValues = newRunAttributeValues;
+this.runArraySize = newArraySize;
+}var newRunAttributes = null;
+var newRunAttributeValues = null;
+if (copyAttrs) {
+var oldRunAttributes = this.runAttributes[runIndex - 1];
+var oldRunAttributeValues = this.runAttributeValues[runIndex - 1];
+if (oldRunAttributes != null) {
+newRunAttributes = oldRunAttributes.clone ();
+}if (oldRunAttributeValues != null) {
+newRunAttributeValues = oldRunAttributeValues.clone ();
+}}this.runCount++;
+for (var i = this.runCount - 1; i > runIndex; i--) {
+this.runStarts[i] = this.runStarts[i - 1];
+this.runAttributes[i] = this.runAttributes[i - 1];
+this.runAttributeValues[i] = this.runAttributeValues[i - 1];
+}
+this.runStarts[runIndex] = offset;
+this.runAttributes[runIndex] = newRunAttributes;
+this.runAttributeValues[runIndex] = newRunAttributeValues;
+return runIndex;
+}, "~N,~B");
+Clazz.defineMethod (c$, "addAttributeRunData", 
+ function (attribute, value, beginRunIndex, endRunIndex) {
+for (var i = beginRunIndex; i < endRunIndex; i++) {
+var keyValueIndex = -1;
+if (this.runAttributes[i] == null) {
+var newRunAttributes =  new java.util.Vector ();
+var newRunAttributeValues =  new java.util.Vector ();
+this.runAttributes[i] = newRunAttributes;
+this.runAttributeValues[i] = newRunAttributeValues;
+} else {
+keyValueIndex = this.runAttributes[i].indexOf (attribute);
+}if (keyValueIndex == -1) {
+var oldSize = this.runAttributes[i].size ();
+this.runAttributes[i].addElement (attribute);
+try {
+this.runAttributeValues[i].addElement (value);
+} catch (e) {
+if (Clazz.exceptionOf (e, Exception)) {
+this.runAttributes[i].setSize (oldSize);
+this.runAttributeValues[i].setSize (oldSize);
+} else {
+throw e;
+}
+}
+} else {
+this.runAttributeValues[i].set (keyValueIndex, value);
+}}
+}, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");
+Clazz.defineMethod (c$, "getIterator", 
+function () {
+return this.getIterator (null, 0, this.length ());
+});
+Clazz.defineMethod (c$, "getIterator", 
+function (attributes) {
+return this.getIterator (attributes, 0, this.length ());
+}, "~A");
+Clazz.defineMethod (c$, "getIterator", 
+function (attributes, beginIndex, endIndex) {
+return Clazz.innerTypeInstance (java.text.AttributedString.AttributedStringIterator, this, null, attributes, beginIndex, endIndex);
+}, "~A,~N,~N");
+Clazz.defineMethod (c$, "length", 
+function () {
+return this.text.length;
+});
+Clazz.defineMethod (c$, "charAt", 
+ function (index) {
+return this.text.charAt (index);
+}, "~N");
+Clazz.defineMethod (c$, "getAttribute", 
+ function (attribute, runIndex) {
+var currentRunAttributes = this.runAttributes[runIndex];
+var currentRunAttributeValues = this.runAttributeValues[runIndex];
+if (currentRunAttributes == null) {
+return null;
+}var attributeIndex = currentRunAttributes.indexOf (attribute);
+if (attributeIndex != -1) {
+return currentRunAttributeValues.elementAt (attributeIndex);
+} else {
+return null;
+}}, "java.text.AttributedCharacterIterator.Attribute,~N");
+Clazz.defineMethod (c$, "getAttributeCheckRange", 
+ function (attribute, runIndex, beginIndex, endIndex) {
+var value = this.getAttribute (attribute, runIndex);
+if (Clazz.instanceOf (value, java.text.Annotation)) {
+if (beginIndex > 0) {
+var currIndex = runIndex;
+var runStart = this.runStarts[currIndex];
+while (runStart >= beginIndex && java.text.AttributedString.valuesMatch (value, this.getAttribute (attribute, currIndex - 1))) {
+currIndex--;
+runStart = this.runStarts[currIndex];
+}
+if (runStart < beginIndex) {
+return null;
+}}var textLength = this.length ();
+if (endIndex < textLength) {
+var currIndex = runIndex;
+var runLimit = (currIndex < this.runCount - 1) ? this.runStarts[currIndex + 1] : textLength;
+while (runLimit <= endIndex && java.text.AttributedString.valuesMatch (value, this.getAttribute (attribute, currIndex + 1))) {
+currIndex++;
+runLimit = (currIndex < this.runCount - 1) ? this.runStarts[currIndex + 1] : textLength;
+}
+if (runLimit > endIndex) {
+return null;
+}}}return value;
+}, "java.text.AttributedCharacterIterator.Attribute,~N,~N,~N");
+Clazz.defineMethod (c$, "attributeValuesMatch", 
+ function (attributes, runIndex1, runIndex2) {
+var iterator = attributes.iterator ();
+while (iterator.hasNext ()) {
+var key = iterator.next ();
+if (!java.text.AttributedString.valuesMatch (this.getAttribute (key, runIndex1), this.getAttribute (key, runIndex2))) {
+return false;
+}}
+return true;
+}, "java.util.Set,~N,~N");
+c$.valuesMatch = Clazz.defineMethod (c$, "valuesMatch", 
+ function (value1, value2) {
+if (value1 == null) {
+return value2 == null;
+} else {
+return value1.equals (value2);
+}}, "~O,~O");
+Clazz.defineMethod (c$, "appendContents", 
+ function (buf, iterator) {
+var index = iterator.getBeginIndex ();
+var end = iterator.getEndIndex ();
+while (index < end) {
+iterator.setIndex (index++);
+buf.append (iterator.current ());
+}
+}, "StringBuffer,java.text.CharacterIterator");
+Clazz.defineMethod (c$, "setAttributes", 
+ function (attrs, offset) {
+if (this.runCount == 0) {
+this.createRunAttributeDataVectors ();
+}var index = this.ensureRunBreak (offset, false);
+var size;
+if (attrs != null && (size = attrs.size ()) > 0) {
+var runAttrs =  new java.util.Vector (size);
+var runValues =  new java.util.Vector (size);
+var iterator = attrs.entrySet ().iterator ();
+while (iterator.hasNext ()) {
+var entry = iterator.next ();
+runAttrs.add (entry.getKey ());
+runValues.add (entry.getValue ());
+}
+this.runAttributes[index] = runAttrs;
+this.runAttributeValues[index] = runValues;
+}}, "java.util.Map,~N");
+c$.mapsDiffer = Clazz.defineMethod (c$, "mapsDiffer", 
+ function (last, attrs) {
+if (last == null) {
+return (attrs != null && attrs.size () > 0);
+}return (!last.equals (attrs));
+}, "java.util.Map,java.util.Map");
+c$.$AttributedString$AttributedStringIterator$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.beginIndex = 0;
+this.endIndex = 0;
+this.currentIndex = 0;
+this.currentRunIndex = 0;
+this.currentRunStart = 0;
+this.currentRunLimit = 0;
+Clazz.instantialize (this, arguments);
+}, java.text.AttributedString, "AttributedStringIterator", null, java.text.AttributedCharacterIterator);
+Clazz.makeConstructor (c$, 
+function (a, b, c) {
+if (b < 0 || b > c || c > this.b$["java.text.AttributedString"].length ()) {
+throw  new IllegalArgumentException ("Invalid substring range");
+}this.beginIndex = b;
+this.endIndex = c;
+this.currentIndex = b;
+this.updateRunInfo ();
+}, "~A,~N,~N");
+Clazz.overrideMethod (c$, "equals", 
+function (a) {
+if (this === a) {
+return true;
+}if (!(Clazz.instanceOf (a, java.text.AttributedString.AttributedStringIterator))) {
+return false;
+}var b = a;
+if (this.b$["java.text.AttributedString"] !== b.getString ()) return false;
+if (this.currentIndex != b.currentIndex || this.beginIndex != b.beginIndex || this.endIndex != b.endIndex) return false;
+return true;
+}, "~O");
+Clazz.overrideMethod (c$, "hashCode", 
+function () {
+return this.b$["java.text.AttributedString"].text.hashCode () ^ this.currentIndex ^ this.beginIndex ^ this.endIndex;
+});
+Clazz.overrideMethod (c$, "clone", 
+function () {
+try {
+var a = Clazz.superCall (this, java.text.AttributedString.AttributedStringIterator, "clone", []);
+return a;
+} catch (e) {
+if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
+throw  new InternalError ();
+} else {
+throw e;
+}
+}
+});
+Clazz.overrideMethod (c$, "first", 
+function () {
+return this.internalSetIndex (this.beginIndex);
+});
+Clazz.overrideMethod (c$, "last", 
+function () {
+if (this.endIndex == this.beginIndex) {
+return this.internalSetIndex (this.endIndex);
+} else {
+return this.internalSetIndex (this.endIndex - 1);
+}});
+Clazz.overrideMethod (c$, "current", 
+function () {
+if (this.currentIndex == this.endIndex) {
+return '\uffff';
+} else {
+return this.b$["java.text.AttributedString"].charAt (this.currentIndex);
+}});
+Clazz.overrideMethod (c$, "next", 
+function () {
+if (this.currentIndex < this.endIndex) {
+return this.internalSetIndex (this.currentIndex + 1);
+} else {
+return '\uffff';
+}});
+Clazz.overrideMethod (c$, "previous", 
+function () {
+if (this.currentIndex > this.beginIndex) {
+return this.internalSetIndex (this.currentIndex - 1);
+} else {
+return '\uffff';
+}});
+Clazz.overrideMethod (c$, "setIndex", 
+function (a) {
+if (a < this.beginIndex || a > this.endIndex) throw  new IllegalArgumentException ("Invalid index");
+return this.internalSetIndex (a);
+}, "~N");
+Clazz.overrideMethod (c$, "getBeginIndex", 
+function () {
+return this.beginIndex;
+});
+Clazz.overrideMethod (c$, "getEndIndex", 
+function () {
+return this.endIndex;
+});
+Clazz.overrideMethod (c$, "getIndex", 
+function () {
+return this.currentIndex;
+});
+Clazz.defineMethod (c$, "getRunStart", 
+function () {
+return this.currentRunStart;
+});
+Clazz.defineMethod (c$, "getRunStart", 
+function (a) {
+if (this.currentRunStart == this.beginIndex || this.currentRunIndex == -1) {
+return this.currentRunStart;
+} else {
+var b = this.getAttribute (a);
+var c = this.currentRunStart;
+var d = this.currentRunIndex;
+while (c > this.beginIndex && java.text.AttributedString.valuesMatch (b, this.b$["java.text.AttributedString"].getAttribute (a, d - 1))) {
+d--;
+c = this.b$["java.text.AttributedString"].runStarts[d];
+}
+if (c < this.beginIndex) {
+c = this.beginIndex;
+}return c;
+}}, "java.text.AttributedCharacterIterator.Attribute");
+Clazz.defineMethod (c$, "getRunStart", 
+function (a) {
+if (this.currentRunStart == this.beginIndex || this.currentRunIndex == -1) {
+return this.currentRunStart;
+} else {
+var b = this.currentRunStart;
+var c = this.currentRunIndex;
+while (b > this.beginIndex && this.b$["java.text.AttributedString"].attributeValuesMatch (a, this.currentRunIndex, c - 1)) {
+c--;
+b = this.b$["java.text.AttributedString"].runStarts[c];
+}
+if (b < this.beginIndex) {
+b = this.beginIndex;
+}return b;
+}}, "java.util.Set");
+Clazz.defineMethod (c$, "getRunLimit", 
+function () {
+return this.currentRunLimit;
+});
+Clazz.defineMethod (c$, "getRunLimit", 
+function (a) {
+if (this.currentRunLimit == this.endIndex || this.currentRunIndex == -1) {
+return this.currentRunLimit;
+} else {
+var b = this.getAttribute (a);
+var c = this.currentRunLimit;
+var d = this.currentRunIndex;
+while (c < this.endIndex && java.text.AttributedString.valuesMatch (b, this.b$["java.text.AttributedString"].getAttribute (a, d + 1))) {
+d++;
+c = d < this.b$["java.text.AttributedString"].runCount - 1 ? this.b$["java.text.AttributedString"].runStarts[d + 1] : this.endIndex;
+}
+if (c > this.endIndex) {
+c = this.endIndex;
+}return c;
+}}, "java.text.AttributedCharacterIterator.Attribute");
+Clazz.defineMethod (c$, "getRunLimit", 
+function (a) {
+if (this.currentRunLimit == this.endIndex || this.currentRunIndex == -1) {
+return this.currentRunLimit;
+} else {
+var b = this.currentRunLimit;
+var c = this.currentRunIndex;
+while (b < this.endIndex && this.b$["java.text.AttributedString"].attributeValuesMatch (a, this.currentRunIndex, c + 1)) {
+c++;
+b = c < this.b$["java.text.AttributedString"].runCount - 1 ? this.b$["java.text.AttributedString"].runStarts[c + 1] : this.endIndex;
+}
+if (b > this.endIndex) {
+b = this.endIndex;
+}return b;
+}}, "java.util.Set");
+Clazz.overrideMethod (c$, "getAttributes", 
+function () {
+if (this.b$["java.text.AttributedString"].runAttributes == null || this.currentRunIndex == -1 || this.b$["java.text.AttributedString"].runAttributes[this.currentRunIndex] == null) {
+return  new java.util.Hashtable ();
+}return Clazz.innerTypeInstance (java.text.AttributedString.AttributeMap, this, null, this.currentRunIndex, this.beginIndex, this.endIndex);
+});
+Clazz.overrideMethod (c$, "getAllAttributeKeys", 
+function () {
+if (this.b$["java.text.AttributedString"].runAttributes == null) {
+return  new java.util.HashSet ();
+}{
+var a =  new java.util.HashSet ();
+var b = 0;
+while (b < this.b$["java.text.AttributedString"].runCount) {
+if (this.b$["java.text.AttributedString"].runStarts[b] < this.endIndex && (b == this.b$["java.text.AttributedString"].runCount - 1 || this.b$["java.text.AttributedString"].runStarts[b + 1] > this.beginIndex)) {
+var c = this.b$["java.text.AttributedString"].runAttributes[b];
+if (c != null) {
+var d = c.size ();
+while (d-- > 0) {
+a.add (c.get (d));
+}
+}}b++;
+}
+return a;
+}});
+Clazz.overrideMethod (c$, "getAttribute", 
+function (a) {
+var b = this.currentRunIndex;
+if (b < 0) {
+return null;
+}return this.b$["java.text.AttributedString"].getAttributeCheckRange (a, b, this.beginIndex, this.endIndex);
+}, "java.text.AttributedCharacterIterator.Attribute");
+Clazz.defineMethod (c$, "getString", 
+ function () {
+return this.b$["java.text.AttributedString"];
+});
+Clazz.defineMethod (c$, "internalSetIndex", 
+ function (a) {
+this.currentIndex = a;
+if (a < this.currentRunStart || a >= this.currentRunLimit) {
+this.updateRunInfo ();
+}if (this.currentIndex == this.endIndex) {
+return '\uffff';
+} else {
+return this.b$["java.text.AttributedString"].charAt (a);
+}}, "~N");
+Clazz.defineMethod (c$, "updateRunInfo", 
+ function () {
+if (this.currentIndex == this.endIndex) {
+this.currentRunStart = this.currentRunLimit = this.endIndex;
+this.currentRunIndex = -1;
+} else {
+{
+var a = -1;
+while (a < this.b$["java.text.AttributedString"].runCount - 1 && this.b$["java.text.AttributedString"].runStarts[a + 1] <= this.currentIndex) a++;
+
+this.currentRunIndex = a;
+if (a >= 0) {
+this.currentRunStart = this.b$["java.text.AttributedString"].runStarts[a];
+if (this.currentRunStart < this.beginIndex) this.currentRunStart = this.beginIndex;
+} else {
+this.currentRunStart = this.beginIndex;
+}if (a < this.b$["java.text.AttributedString"].runCount - 1) {
+this.currentRunLimit = this.b$["java.text.AttributedString"].runStarts[a + 1];
+if (this.currentRunLimit > this.endIndex) this.currentRunLimit = this.endIndex;
+} else {
+this.currentRunLimit = this.endIndex;
+}}}});
+c$ = Clazz.p0p ();
+};
+c$.$AttributedString$AttributeMap$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.runIndex = 0;
+this.beginIndex = 0;
+this.endIndex = 0;
+Clazz.instantialize (this, arguments);
+}, java.text.AttributedString, "AttributeMap", java.util.AbstractMap);
+Clazz.makeConstructor (c$, 
+function (a, b, c) {
+Clazz.superConstructor (this, java.text.AttributedString.AttributeMap, []);
+this.runIndex = a;
+this.beginIndex = b;
+this.endIndex = c;
+}, "~N,~N,~N");
+Clazz.overrideMethod (c$, "entrySet", 
+function () {
+var a =  new java.util.HashSet ();
+{
+var b = this.b$["java.text.AttributedString"].runAttributes[this.runIndex].size ();
+for (var c = 0; c < b; c++) {
+var d = this.b$["java.text.AttributedString"].runAttributes[this.runIndex].get (c);
+var e = this.b$["java.text.AttributedString"].runAttributeValues[this.runIndex].get (c);
+if (Clazz.instanceOf (e, java.text.Annotation)) {
+e = this.b$["java.text.AttributedString"].getAttributeCheckRange (d, this.runIndex, this.beginIndex, this.endIndex);
+if (e == null) {
+continue;
+}}var f =  new java.text.AttributeEntry (d, e);
+a.add (f);
+}
+}return a;
+});
+Clazz.overrideMethod (c$, "get", 
+function (a) {
+return this.b$["java.text.AttributedString"].getAttributeCheckRange (a, this.runIndex, this.beginIndex, this.endIndex);
+}, "~O");
+c$ = Clazz.p0p ();
+};
+Clazz.defineStatics (c$,
+"ARRAY_SIZE_INCREMENT", 10);
+c$ = Clazz.decorateAsClass (function () {
+this.key = null;
+this.value = null;
+Clazz.instantialize (this, arguments);
+}, java.text, "AttributeEntry", null, java.util.Map.Entry);
+Clazz.makeConstructor (c$, 
+function (key, value) {
+this.key = key;
+this.value = value;
+}, "java.text.AttributedCharacterIterator.Attribute,~O");
+Clazz.overrideMethod (c$, "equals", 
+function (o) {
+if (!(Clazz.instanceOf (o, java.text.AttributeEntry))) {
+return false;
+}var other = o;
+return other.key.equals (this.key) && (this.value == null ? other.value == null : other.value.equals (this.value));
+}, "~O");
+Clazz.overrideMethod (c$, "getKey", 
+function () {
+return this.key;
+});
+Clazz.overrideMethod (c$, "getValue", 
+function () {
+return this.value;
+});
+Clazz.overrideMethod (c$, "setValue", 
+function (newValue) {
+throw  new UnsupportedOperationException ();
+}, "~O");
+Clazz.overrideMethod (c$, "hashCode", 
+function () {
+return this.key.hashCode () ^ (this.value == null ? 0 : this.value.hashCode ());
+});
+Clazz.defineMethod (c$, "toString", 
+function () {
+return this.key.toString () + "=" + this.value.toString ();
+});
+});