1 Clazz.declarePackage ("java.text");
\r
2 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
3 c$ = Clazz.decorateAsClass (function () {
\r
5 this.runArraySize = 0;
\r
7 this.runStarts = null;
\r
8 this.runAttributes = null;
\r
9 this.runAttributeValues = null;
\r
10 if (!Clazz.isClassDefined ("java.text.AttributedString.AttributedStringIterator")) {
\r
11 java.text.AttributedString.$AttributedString$AttributedStringIterator$ ();
\r
13 if (!Clazz.isClassDefined ("java.text.AttributedString.AttributeMap")) {
\r
14 java.text.AttributedString.$AttributedString$AttributeMap$ ();
\r
16 Clazz.instantialize (this, arguments);
\r
17 }, java.text, "AttributedString");
\r
18 Clazz.makeConstructor (c$,
\r
19 function (iterators) {
\r
20 if (iterators == null) {
\r
21 throw new NullPointerException ("Iterators must not be null");
\r
22 }if (iterators.length == 0) {
\r
25 var buffer = new StringBuffer ();
\r
26 for (var counter = 0; counter < iterators.length; counter++) {
\r
27 this.appendContents (buffer, iterators[counter]);
\r
29 this.text = buffer.toString ();
\r
30 if (this.text.length > 0) {
\r
33 for (var counter = 0; counter < iterators.length; counter++) {
\r
34 var iterator = iterators[counter];
\r
35 var start = iterator.getBeginIndex ();
\r
36 var end = iterator.getEndIndex ();
\r
38 while (index < end) {
\r
39 iterator.setIndex (index);
\r
40 var attrs = iterator.getAttributes ();
\r
41 if (java.text.AttributedString.mapsDiffer (last, attrs)) {
\r
42 this.setAttributes (attrs, index - start + offset);
\r
44 index = iterator.getRunLimit ();
\r
46 offset += (end - start);
\r
49 Clazz.makeConstructor (c$,
\r
52 throw new NullPointerException ();
\r
55 Clazz.makeConstructor (c$,
\r
56 function (text, attributes) {
\r
57 if (text == null || attributes == null) {
\r
58 throw new NullPointerException ();
\r
60 if (text.length == 0) {
\r
61 if (attributes.isEmpty ()) return;
\r
62 throw new IllegalArgumentException ("Can't add attribute to 0-length text");
\r
63 }var attributeCount = attributes.size ();
\r
64 if (attributeCount > 0) {
\r
65 this.createRunAttributeDataVectors ();
\r
66 var newRunAttributes = new java.util.Vector (attributeCount);
\r
67 var newRunAttributeValues = new java.util.Vector (attributeCount);
\r
68 this.runAttributes[0] = newRunAttributes;
\r
69 this.runAttributeValues[0] = newRunAttributeValues;
\r
70 var iterator = attributes.entrySet ().iterator ();
\r
71 while (iterator.hasNext ()) {
\r
72 var entry = iterator.next ();
\r
73 newRunAttributes.addElement (entry.getKey ());
\r
74 newRunAttributeValues.addElement (entry.getValue ());
\r
76 }}, "~S,java.util.Map");
\r
77 Clazz.makeConstructor (c$,
\r
79 this.construct (text, text.getBeginIndex (), text.getEndIndex (), null);
\r
80 }, "java.text.AttributedCharacterIterator");
\r
81 Clazz.makeConstructor (c$,
\r
82 function (text, beginIndex, endIndex) {
\r
83 this.construct (text, beginIndex, endIndex, null);
\r
84 }, "java.text.AttributedCharacterIterator,~N,~N");
\r
85 Clazz.makeConstructor (c$,
\r
86 function (text, beginIndex, endIndex, attributes) {
\r
88 throw new NullPointerException ();
\r
89 }var textBeginIndex = text.getBeginIndex ();
\r
90 var textEndIndex = text.getEndIndex ();
\r
91 if (beginIndex < textBeginIndex || endIndex > textEndIndex || beginIndex > endIndex) throw new IllegalArgumentException ("Invalid substring range");
\r
92 var textBuffer = new StringBuffer ();
\r
93 text.setIndex (beginIndex);
\r
94 for (var c = text.current (); text.getIndex () < endIndex; c = text.next ()) textBuffer.append (c);
\r
96 this.text = textBuffer.toString ();
\r
97 if (beginIndex == endIndex) return;
\r
98 var keys = new java.util.HashSet ();
\r
99 if (attributes == null) {
\r
100 keys.addAll (text.getAllAttributeKeys ());
\r
102 for (var i = 0; i < attributes.length; i++) keys.add (attributes[i]);
\r
104 keys.retainAll (text.getAllAttributeKeys ());
\r
105 }if (keys.isEmpty ()) return;
\r
106 var itr = keys.iterator ();
\r
107 while (itr.hasNext ()) {
\r
108 var attributeKey = itr.next ();
\r
109 text.setIndex (textBeginIndex);
\r
110 while (text.getIndex () < endIndex) {
\r
111 var start = text.getRunStart (attributeKey);
\r
112 var limit = text.getRunLimit (attributeKey);
\r
113 var value = text.getAttribute (attributeKey);
\r
114 if (value != null) {
\r
115 if (Clazz.instanceOf (value, java.text.Annotation)) {
\r
116 if (start >= beginIndex && limit <= endIndex) {
\r
117 this.addAttribute (attributeKey, value, start - beginIndex, limit - beginIndex);
\r
119 if (limit > endIndex) break;
\r
121 if (start >= endIndex) break;
\r
122 if (limit > beginIndex) {
\r
123 if (start < beginIndex) start = beginIndex;
\r
124 if (limit > endIndex) limit = endIndex;
\r
125 if (start != limit) {
\r
126 this.addAttribute (attributeKey, value, start - beginIndex, limit - beginIndex);
\r
127 }}}}text.setIndex (limit);
\r
130 }, "java.text.AttributedCharacterIterator,~N,~N,~A");
\r
131 Clazz.defineMethod (c$, "addAttribute",
\r
132 function (attribute, value) {
\r
133 if (attribute == null) {
\r
134 throw new NullPointerException ();
\r
135 }var len = this.length ();
\r
137 throw new IllegalArgumentException ("Can't add attribute to 0-length text");
\r
138 }this.addAttributeImpl (attribute, value, 0, len);
\r
139 }, "java.text.AttributedCharacterIterator.Attribute,~O");
\r
140 Clazz.defineMethod (c$, "addAttribute",
\r
141 function (attribute, value, beginIndex, endIndex) {
\r
142 if (attribute == null) {
\r
143 throw new NullPointerException ();
\r
144 }if (beginIndex < 0 || endIndex > this.length () || beginIndex >= endIndex) {
\r
145 throw new IllegalArgumentException ("Invalid substring range");
\r
146 }this.addAttributeImpl (attribute, value, beginIndex, endIndex);
\r
147 }, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");
\r
148 Clazz.defineMethod (c$, "addAttributes",
\r
149 function (attributes, beginIndex, endIndex) {
\r
150 if (attributes == null) {
\r
151 throw new NullPointerException ();
\r
152 }if (beginIndex < 0 || endIndex > this.length () || beginIndex > endIndex) {
\r
153 throw new IllegalArgumentException ("Invalid substring range");
\r
154 }if (beginIndex == endIndex) {
\r
155 if (attributes.isEmpty ()) return;
\r
156 throw new IllegalArgumentException ("Can't add attribute to 0-length text");
\r
157 }if (this.runCount == 0) {
\r
158 this.createRunAttributeDataVectors ();
\r
159 }var beginRunIndex = this.ensureRunBreak (beginIndex);
\r
160 var endRunIndex = this.ensureRunBreak (endIndex);
\r
161 var iterator = attributes.entrySet ().iterator ();
\r
162 while (iterator.hasNext ()) {
\r
163 var entry = iterator.next ();
\r
164 this.addAttributeRunData (entry.getKey (), entry.getValue (), beginRunIndex, endRunIndex);
\r
166 }, "java.util.Map,~N,~N");
\r
167 Clazz.defineMethod (c$, "addAttributeImpl",
\r
168 function (attribute, value, beginIndex, endIndex) {
\r
169 if (this.runCount == 0) {
\r
170 this.createRunAttributeDataVectors ();
\r
171 }var beginRunIndex = this.ensureRunBreak (beginIndex);
\r
172 var endRunIndex = this.ensureRunBreak (endIndex);
\r
173 this.addAttributeRunData (attribute, value, beginRunIndex, endRunIndex);
\r
174 }, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");
\r
175 Clazz.defineMethod (c$, "createRunAttributeDataVectors",
\r
177 var newRunStarts = Clazz.newIntArray (10, 0);
\r
178 var newRunAttributes = new Array (10);
\r
179 var newRunAttributeValues = new Array (10);
\r
180 this.runStarts = newRunStarts;
\r
181 this.runAttributes = newRunAttributes;
\r
182 this.runAttributeValues = newRunAttributeValues;
\r
183 this.runArraySize = 10;
\r
186 Clazz.defineMethod (c$, "ensureRunBreak",
\r
187 function (offset) {
\r
188 return this.ensureRunBreak (offset, true);
\r
190 Clazz.defineMethod (c$, "ensureRunBreak",
\r
191 function (offset, copyAttrs) {
\r
192 if (offset == this.length ()) {
\r
193 return this.runCount;
\r
195 while (runIndex < this.runCount && this.runStarts[runIndex] < offset) {
\r
198 if (runIndex < this.runCount && this.runStarts[runIndex] == offset) {
\r
200 }if (this.runCount == this.runArraySize) {
\r
201 var newArraySize = this.runArraySize + 10;
\r
202 var newRunStarts = Clazz.newIntArray (newArraySize, 0);
\r
203 var newRunAttributes = new Array (newArraySize);
\r
204 var newRunAttributeValues = new Array (newArraySize);
\r
205 for (var i = 0; i < this.runArraySize; i++) {
\r
206 newRunStarts[i] = this.runStarts[i];
\r
207 newRunAttributes[i] = this.runAttributes[i];
\r
208 newRunAttributeValues[i] = this.runAttributeValues[i];
\r
210 this.runStarts = newRunStarts;
\r
211 this.runAttributes = newRunAttributes;
\r
212 this.runAttributeValues = newRunAttributeValues;
\r
213 this.runArraySize = newArraySize;
\r
214 }var newRunAttributes = null;
\r
215 var newRunAttributeValues = null;
\r
217 var oldRunAttributes = this.runAttributes[runIndex - 1];
\r
218 var oldRunAttributeValues = this.runAttributeValues[runIndex - 1];
\r
219 if (oldRunAttributes != null) {
\r
220 newRunAttributes = oldRunAttributes.clone ();
\r
221 }if (oldRunAttributeValues != null) {
\r
222 newRunAttributeValues = oldRunAttributeValues.clone ();
\r
224 for (var i = this.runCount - 1; i > runIndex; i--) {
\r
225 this.runStarts[i] = this.runStarts[i - 1];
\r
226 this.runAttributes[i] = this.runAttributes[i - 1];
\r
227 this.runAttributeValues[i] = this.runAttributeValues[i - 1];
\r
229 this.runStarts[runIndex] = offset;
\r
230 this.runAttributes[runIndex] = newRunAttributes;
\r
231 this.runAttributeValues[runIndex] = newRunAttributeValues;
\r
234 Clazz.defineMethod (c$, "addAttributeRunData",
\r
235 function (attribute, value, beginRunIndex, endRunIndex) {
\r
236 for (var i = beginRunIndex; i < endRunIndex; i++) {
\r
237 var keyValueIndex = -1;
\r
238 if (this.runAttributes[i] == null) {
\r
239 var newRunAttributes = new java.util.Vector ();
\r
240 var newRunAttributeValues = new java.util.Vector ();
\r
241 this.runAttributes[i] = newRunAttributes;
\r
242 this.runAttributeValues[i] = newRunAttributeValues;
\r
244 keyValueIndex = this.runAttributes[i].indexOf (attribute);
\r
245 }if (keyValueIndex == -1) {
\r
246 var oldSize = this.runAttributes[i].size ();
\r
247 this.runAttributes[i].addElement (attribute);
\r
249 this.runAttributeValues[i].addElement (value);
\r
251 if (Clazz.exceptionOf (e, Exception)) {
\r
252 this.runAttributes[i].setSize (oldSize);
\r
253 this.runAttributeValues[i].setSize (oldSize);
\r
259 this.runAttributeValues[i].set (keyValueIndex, value);
\r
261 }, "java.text.AttributedCharacterIterator.Attribute,~O,~N,~N");
\r
262 Clazz.defineMethod (c$, "getIterator",
\r
264 return this.getIterator (null, 0, this.length ());
\r
266 Clazz.defineMethod (c$, "getIterator",
\r
267 function (attributes) {
\r
268 return this.getIterator (attributes, 0, this.length ());
\r
270 Clazz.defineMethod (c$, "getIterator",
\r
271 function (attributes, beginIndex, endIndex) {
\r
272 return Clazz.innerTypeInstance (java.text.AttributedString.AttributedStringIterator, this, null, attributes, beginIndex, endIndex);
\r
274 Clazz.defineMethod (c$, "length",
\r
276 return this.text.length;
\r
278 Clazz.defineMethod (c$, "charAt",
\r
280 return this.text.charAt (index);
\r
282 Clazz.defineMethod (c$, "getAttribute",
\r
283 function (attribute, runIndex) {
\r
284 var currentRunAttributes = this.runAttributes[runIndex];
\r
285 var currentRunAttributeValues = this.runAttributeValues[runIndex];
\r
286 if (currentRunAttributes == null) {
\r
288 }var attributeIndex = currentRunAttributes.indexOf (attribute);
\r
289 if (attributeIndex != -1) {
\r
290 return currentRunAttributeValues.elementAt (attributeIndex);
\r
293 }}, "java.text.AttributedCharacterIterator.Attribute,~N");
\r
294 Clazz.defineMethod (c$, "getAttributeCheckRange",
\r
295 function (attribute, runIndex, beginIndex, endIndex) {
\r
296 var value = this.getAttribute (attribute, runIndex);
\r
297 if (Clazz.instanceOf (value, java.text.Annotation)) {
\r
298 if (beginIndex > 0) {
\r
299 var currIndex = runIndex;
\r
300 var runStart = this.runStarts[currIndex];
\r
301 while (runStart >= beginIndex && java.text.AttributedString.valuesMatch (value, this.getAttribute (attribute, currIndex - 1))) {
\r
303 runStart = this.runStarts[currIndex];
\r
305 if (runStart < beginIndex) {
\r
307 }}var textLength = this.length ();
\r
308 if (endIndex < textLength) {
\r
309 var currIndex = runIndex;
\r
310 var runLimit = (currIndex < this.runCount - 1) ? this.runStarts[currIndex + 1] : textLength;
\r
311 while (runLimit <= endIndex && java.text.AttributedString.valuesMatch (value, this.getAttribute (attribute, currIndex + 1))) {
\r
313 runLimit = (currIndex < this.runCount - 1) ? this.runStarts[currIndex + 1] : textLength;
\r
315 if (runLimit > endIndex) {
\r
318 }, "java.text.AttributedCharacterIterator.Attribute,~N,~N,~N");
\r
319 Clazz.defineMethod (c$, "attributeValuesMatch",
\r
320 function (attributes, runIndex1, runIndex2) {
\r
321 var iterator = attributes.iterator ();
\r
322 while (iterator.hasNext ()) {
\r
323 var key = iterator.next ();
\r
324 if (!java.text.AttributedString.valuesMatch (this.getAttribute (key, runIndex1), this.getAttribute (key, runIndex2))) {
\r
328 }, "java.util.Set,~N,~N");
\r
329 c$.valuesMatch = Clazz.defineMethod (c$, "valuesMatch",
\r
330 function (value1, value2) {
\r
331 if (value1 == null) {
\r
332 return value2 == null;
\r
334 return value1.equals (value2);
\r
336 Clazz.defineMethod (c$, "appendContents",
\r
337 function (buf, iterator) {
\r
338 var index = iterator.getBeginIndex ();
\r
339 var end = iterator.getEndIndex ();
\r
340 while (index < end) {
\r
341 iterator.setIndex (index++);
\r
342 buf.append (iterator.current ());
\r
344 }, "StringBuffer,java.text.CharacterIterator");
\r
345 Clazz.defineMethod (c$, "setAttributes",
\r
346 function (attrs, offset) {
\r
347 if (this.runCount == 0) {
\r
348 this.createRunAttributeDataVectors ();
\r
349 }var index = this.ensureRunBreak (offset, false);
\r
351 if (attrs != null && (size = attrs.size ()) > 0) {
\r
352 var runAttrs = new java.util.Vector (size);
\r
353 var runValues = new java.util.Vector (size);
\r
354 var iterator = attrs.entrySet ().iterator ();
\r
355 while (iterator.hasNext ()) {
\r
356 var entry = iterator.next ();
\r
357 runAttrs.add (entry.getKey ());
\r
358 runValues.add (entry.getValue ());
\r
360 this.runAttributes[index] = runAttrs;
\r
361 this.runAttributeValues[index] = runValues;
\r
362 }}, "java.util.Map,~N");
\r
363 c$.mapsDiffer = Clazz.defineMethod (c$, "mapsDiffer",
\r
364 function (last, attrs) {
\r
365 if (last == null) {
\r
366 return (attrs != null && attrs.size () > 0);
\r
367 }return (!last.equals (attrs));
\r
368 }, "java.util.Map,java.util.Map");
\r
369 c$.$AttributedString$AttributedStringIterator$ = function () {
\r
370 Clazz.pu$h(self.c$);
\r
371 c$ = Clazz.decorateAsClass (function () {
\r
372 Clazz.prepareCallback (this, arguments);
\r
373 this.beginIndex = 0;
\r
375 this.currentIndex = 0;
\r
376 this.currentRunIndex = 0;
\r
377 this.currentRunStart = 0;
\r
378 this.currentRunLimit = 0;
\r
379 Clazz.instantialize (this, arguments);
\r
380 }, java.text.AttributedString, "AttributedStringIterator", null, java.text.AttributedCharacterIterator);
\r
381 Clazz.makeConstructor (c$,
\r
382 function (a, b, c) {
\r
383 if (b < 0 || b > c || c > this.b$["java.text.AttributedString"].length ()) {
\r
384 throw new IllegalArgumentException ("Invalid substring range");
\r
385 }this.beginIndex = b;
\r
387 this.currentIndex = b;
\r
388 this.updateRunInfo ();
\r
390 Clazz.overrideMethod (c$, "equals",
\r
394 }if (!(Clazz.instanceOf (a, java.text.AttributedString.AttributedStringIterator))) {
\r
397 if (this.b$["java.text.AttributedString"] !== b.getString ()) return false;
\r
398 if (this.currentIndex != b.currentIndex || this.beginIndex != b.beginIndex || this.endIndex != b.endIndex) return false;
\r
401 Clazz.overrideMethod (c$, "hashCode",
\r
403 return this.b$["java.text.AttributedString"].text.hashCode () ^ this.currentIndex ^ this.beginIndex ^ this.endIndex;
\r
405 Clazz.overrideMethod (c$, "clone",
\r
408 var a = Clazz.superCall (this, java.text.AttributedString.AttributedStringIterator, "clone", []);
\r
411 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
\r
412 throw new InternalError ();
\r
418 Clazz.overrideMethod (c$, "first",
\r
420 return this.internalSetIndex (this.beginIndex);
\r
422 Clazz.overrideMethod (c$, "last",
\r
424 if (this.endIndex == this.beginIndex) {
\r
425 return this.internalSetIndex (this.endIndex);
\r
427 return this.internalSetIndex (this.endIndex - 1);
\r
429 Clazz.overrideMethod (c$, "current",
\r
431 if (this.currentIndex == this.endIndex) {
\r
434 return this.b$["java.text.AttributedString"].charAt (this.currentIndex);
\r
436 Clazz.overrideMethod (c$, "next",
\r
438 if (this.currentIndex < this.endIndex) {
\r
439 return this.internalSetIndex (this.currentIndex + 1);
\r
443 Clazz.overrideMethod (c$, "previous",
\r
445 if (this.currentIndex > this.beginIndex) {
\r
446 return this.internalSetIndex (this.currentIndex - 1);
\r
450 Clazz.overrideMethod (c$, "setIndex",
\r
452 if (a < this.beginIndex || a > this.endIndex) throw new IllegalArgumentException ("Invalid index");
\r
453 return this.internalSetIndex (a);
\r
455 Clazz.overrideMethod (c$, "getBeginIndex",
\r
457 return this.beginIndex;
\r
459 Clazz.overrideMethod (c$, "getEndIndex",
\r
461 return this.endIndex;
\r
463 Clazz.overrideMethod (c$, "getIndex",
\r
465 return this.currentIndex;
\r
467 Clazz.defineMethod (c$, "getRunStart",
\r
469 return this.currentRunStart;
\r
471 Clazz.defineMethod (c$, "getRunStart",
\r
473 if (this.currentRunStart == this.beginIndex || this.currentRunIndex == -1) {
\r
474 return this.currentRunStart;
\r
476 var b = this.getAttribute (a);
\r
477 var c = this.currentRunStart;
\r
478 var d = this.currentRunIndex;
\r
479 while (c > this.beginIndex && java.text.AttributedString.valuesMatch (b, this.b$["java.text.AttributedString"].getAttribute (a, d - 1))) {
\r
481 c = this.b$["java.text.AttributedString"].runStarts[d];
\r
483 if (c < this.beginIndex) {
\r
484 c = this.beginIndex;
\r
486 }}, "java.text.AttributedCharacterIterator.Attribute");
\r
487 Clazz.defineMethod (c$, "getRunStart",
\r
489 if (this.currentRunStart == this.beginIndex || this.currentRunIndex == -1) {
\r
490 return this.currentRunStart;
\r
492 var b = this.currentRunStart;
\r
493 var c = this.currentRunIndex;
\r
494 while (b > this.beginIndex && this.b$["java.text.AttributedString"].attributeValuesMatch (a, this.currentRunIndex, c - 1)) {
\r
496 b = this.b$["java.text.AttributedString"].runStarts[c];
\r
498 if (b < this.beginIndex) {
\r
499 b = this.beginIndex;
\r
501 }}, "java.util.Set");
\r
502 Clazz.defineMethod (c$, "getRunLimit",
\r
504 return this.currentRunLimit;
\r
506 Clazz.defineMethod (c$, "getRunLimit",
\r
508 if (this.currentRunLimit == this.endIndex || this.currentRunIndex == -1) {
\r
509 return this.currentRunLimit;
\r
511 var b = this.getAttribute (a);
\r
512 var c = this.currentRunLimit;
\r
513 var d = this.currentRunIndex;
\r
514 while (c < this.endIndex && java.text.AttributedString.valuesMatch (b, this.b$["java.text.AttributedString"].getAttribute (a, d + 1))) {
\r
516 c = d < this.b$["java.text.AttributedString"].runCount - 1 ? this.b$["java.text.AttributedString"].runStarts[d + 1] : this.endIndex;
\r
518 if (c > this.endIndex) {
\r
521 }}, "java.text.AttributedCharacterIterator.Attribute");
\r
522 Clazz.defineMethod (c$, "getRunLimit",
\r
524 if (this.currentRunLimit == this.endIndex || this.currentRunIndex == -1) {
\r
525 return this.currentRunLimit;
\r
527 var b = this.currentRunLimit;
\r
528 var c = this.currentRunIndex;
\r
529 while (b < this.endIndex && this.b$["java.text.AttributedString"].attributeValuesMatch (a, this.currentRunIndex, c + 1)) {
\r
531 b = c < this.b$["java.text.AttributedString"].runCount - 1 ? this.b$["java.text.AttributedString"].runStarts[c + 1] : this.endIndex;
\r
533 if (b > this.endIndex) {
\r
536 }}, "java.util.Set");
\r
537 Clazz.overrideMethod (c$, "getAttributes",
\r
539 if (this.b$["java.text.AttributedString"].runAttributes == null || this.currentRunIndex == -1 || this.b$["java.text.AttributedString"].runAttributes[this.currentRunIndex] == null) {
\r
540 return new java.util.Hashtable ();
\r
541 }return Clazz.innerTypeInstance (java.text.AttributedString.AttributeMap, this, null, this.currentRunIndex, this.beginIndex, this.endIndex);
\r
543 Clazz.overrideMethod (c$, "getAllAttributeKeys",
\r
545 if (this.b$["java.text.AttributedString"].runAttributes == null) {
\r
546 return new java.util.HashSet ();
\r
548 var a = new java.util.HashSet ();
\r
550 while (b < this.b$["java.text.AttributedString"].runCount) {
\r
551 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
552 var c = this.b$["java.text.AttributedString"].runAttributes[b];
\r
562 Clazz.overrideMethod (c$, "getAttribute",
\r
564 var b = this.currentRunIndex;
\r
567 }return this.b$["java.text.AttributedString"].getAttributeCheckRange (a, b, this.beginIndex, this.endIndex);
\r
568 }, "java.text.AttributedCharacterIterator.Attribute");
\r
569 Clazz.defineMethod (c$, "getString",
\r
571 return this.b$["java.text.AttributedString"];
\r
573 Clazz.defineMethod (c$, "internalSetIndex",
\r
575 this.currentIndex = a;
\r
576 if (a < this.currentRunStart || a >= this.currentRunLimit) {
\r
577 this.updateRunInfo ();
\r
578 }if (this.currentIndex == this.endIndex) {
\r
581 return this.b$["java.text.AttributedString"].charAt (a);
\r
583 Clazz.defineMethod (c$, "updateRunInfo",
\r
585 if (this.currentIndex == this.endIndex) {
\r
586 this.currentRunStart = this.currentRunLimit = this.endIndex;
\r
587 this.currentRunIndex = -1;
\r
591 while (a < this.b$["java.text.AttributedString"].runCount - 1 && this.b$["java.text.AttributedString"].runStarts[a + 1] <= this.currentIndex) a++;
\r
593 this.currentRunIndex = a;
\r
595 this.currentRunStart = this.b$["java.text.AttributedString"].runStarts[a];
\r
596 if (this.currentRunStart < this.beginIndex) this.currentRunStart = this.beginIndex;
\r
598 this.currentRunStart = this.beginIndex;
\r
599 }if (a < this.b$["java.text.AttributedString"].runCount - 1) {
\r
600 this.currentRunLimit = this.b$["java.text.AttributedString"].runStarts[a + 1];
\r
601 if (this.currentRunLimit > this.endIndex) this.currentRunLimit = this.endIndex;
\r
603 this.currentRunLimit = this.endIndex;
\r
607 c$.$AttributedString$AttributeMap$ = function () {
\r
608 Clazz.pu$h(self.c$);
\r
609 c$ = Clazz.decorateAsClass (function () {
\r
610 Clazz.prepareCallback (this, arguments);
\r
612 this.beginIndex = 0;
\r
614 Clazz.instantialize (this, arguments);
\r
615 }, java.text.AttributedString, "AttributeMap", java.util.AbstractMap);
\r
616 Clazz.makeConstructor (c$,
\r
617 function (a, b, c) {
\r
618 Clazz.superConstructor (this, java.text.AttributedString.AttributeMap, []);
\r
620 this.beginIndex = b;
\r
623 Clazz.overrideMethod (c$, "entrySet",
\r
625 var a = new java.util.HashSet ();
\r
627 var b = this.b$["java.text.AttributedString"].runAttributes[this.runIndex].size ();
\r
628 for (var c = 0; c < b; c++) {
\r
629 var d = this.b$["java.text.AttributedString"].runAttributes[this.runIndex].get (c);
\r
630 var e = this.b$["java.text.AttributedString"].runAttributeValues[this.runIndex].get (c);
\r
631 if (Clazz.instanceOf (e, java.text.Annotation)) {
\r
632 e = this.b$["java.text.AttributedString"].getAttributeCheckRange (d, this.runIndex, this.beginIndex, this.endIndex);
\r
635 }}var f = new java.text.AttributeEntry (d, e);
\r
640 Clazz.overrideMethod (c$, "get",
\r
642 return this.b$["java.text.AttributedString"].getAttributeCheckRange (a, this.runIndex, this.beginIndex, this.endIndex);
\r
646 Clazz.defineStatics (c$,
\r
647 "ARRAY_SIZE_INCREMENT", 10);
\r
648 c$ = Clazz.decorateAsClass (function () {
\r
651 Clazz.instantialize (this, arguments);
\r
652 }, java.text, "AttributeEntry", null, java.util.Map.Entry);
\r
653 Clazz.makeConstructor (c$,
\r
654 function (key, value) {
\r
656 this.value = value;
\r
657 }, "java.text.AttributedCharacterIterator.Attribute,~O");
\r
658 Clazz.overrideMethod (c$, "equals",
\r
660 if (!(Clazz.instanceOf (o, java.text.AttributeEntry))) {
\r
663 return other.key.equals (this.key) && (this.value == null ? other.value == null : other.value.equals (this.value));
\r
665 Clazz.overrideMethod (c$, "getKey",
\r
669 Clazz.overrideMethod (c$, "getValue",
\r
673 Clazz.overrideMethod (c$, "setValue",
\r
674 function (newValue) {
\r
675 throw new UnsupportedOperationException ();
\r
677 Clazz.overrideMethod (c$, "hashCode",
\r
679 return this.key.hashCode () ^ (this.value == null ? 0 : this.value.hashCode ());
\r
681 Clazz.defineMethod (c$, "toString",
\r
683 return this.key.toString () + "=" + this.value.toString ();
\r