/[classpath]/classpath/java/text/AttributedString.java
ViewVC logotype

Diff of /classpath/java/text/AttributedString.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by tromey, Thu Apr 29 15:47:26 2004 UTC revision 1.9 by tromey, Tue Aug 17 03:08:22 2004 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
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;
# Line 224  AttributedString(AttributedCharacterIter Line 225  AttributedString(AttributedCharacterIter
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);
# Line 272  AttributedString(AttributedCharacterIter Line 274  AttributedString(AttributedCharacterIter
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    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26