39 |
package java.text; |
package java.text; |
40 |
|
|
41 |
import java.util.Arrays; |
import java.util.Arrays; |
42 |
|
import java.util.ArrayList; |
43 |
import java.util.HashMap; |
import java.util.HashMap; |
44 |
import java.util.Hashtable; |
import java.util.Hashtable; |
45 |
import java.util.Iterator; |
import java.util.Iterator; |
225 |
// Loop through and extract the attributes |
// Loop through and extract the attributes |
226 |
char c = aci.setIndex(begin_index); |
char c = aci.setIndex(begin_index); |
227 |
|
|
228 |
|
ArrayList accum = new ArrayList(); |
229 |
do |
do |
230 |
{ |
{ |
231 |
sb.append(c); |
sb.append(c); |
274 |
Map new_map = new Hashtable(); |
Map new_map = new Hashtable(); |
275 |
new_map.put(attrib, attrib_obj); |
new_map.put(attrib, attrib_obj); |
276 |
|
|
277 |
// Add it to the attribute list. Yes this is a bad way to do things. |
// Add it to the attribute list. |
278 |
AttributeRange[] new_list = new AttributeRange[attribs.length + 1]; |
accum.add(new AttributeRange(new_map, rs, rl)); |
|
System.arraycopy(attribs, 0, new_list, 0, attribs.length); |
|
|
attribs = new_list; |
|
|
attribs[attribs.length - 1] = new AttributeRange(new_map, rs, rl); |
|
279 |
} |
} |
280 |
|
|
281 |
c = aci.next(); |
c = aci.next(); |
282 |
} |
} |
283 |
while(c != CharacterIterator.DONE); |
while(c != CharacterIterator.DONE); |
284 |
|
|
285 |
|
attribs = new AttributeRange[accum.size()]; |
286 |
|
attribs = (AttributeRange[]) accum.toArray(attribs); |
287 |
|
|
288 |
sci = new StringCharacterIterator(sb.toString()); |
sci = new StringCharacterIterator(sb.toString()); |
289 |
} |
} |
290 |
|
|