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

Diff of /classpath/java/text/RuleBasedCollator.java

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

revision 1.8 by mkoch, Thu May 15 13:17:44 2003 UTC revision 1.9 by mkoch, Tue Jun 24 07:12:15 2003 UTC
# Line 443  public class RuleBasedCollator extends C Line 443  public class RuleBasedCollator extends C
443      Vector vect = new Vector(25);      Vector vect = new Vector(25);
444    
445      int ord = cei.next();      int ord = cei.next();
446        cei.reset(); //set to start of string
447    
448      while (ord != CollationElementIterator.NULLORDER)      while (ord != CollationElementIterator.NULLORDER)
449        {        {
450          switch (getStrength())          switch (getStrength())
# Line 459  public class RuleBasedCollator extends C Line 461  public class RuleBasedCollator extends C
461            }            }
462    
463          vect.add(new Integer(ord));          vect.add(new Integer(ord));
464            ord = cei.next(); //increment to next key
465        }        }
466    
467      Object[] objarr = vect.toArray();      Object[] objarr = vect.toArray();
468      byte[] key = new byte[objarr.length * 4];      byte[] key = new byte[objarr.length * 4];
469    
470      for (int i = 0; i < key.length; i++)      for (int i = 0; i < objarr.length; i++)
471        {        {
472          int j = ((Integer)objarr[i]).intValue();          int j = ((Integer)objarr[i]).intValue();
473          key[i++] = (byte)((j & 0xFF000000) >> 24);          key [i * 4] = (byte)((j & 0xFF000000) >> 24);
474          key[i++] = (byte)((j & 0x00FF0000) >> 16);          key [i * 4 + 1] = (byte)((j & 0x00FF0000) >> 16);
475          key[i++] = (byte)((j & 0x0000FF00) >> 8);          key [i * 4 + 2] = (byte)((j & 0x0000FF00) >> 8);
476          key[i++] = (byte)(j & 0x000000FF);          key [i * 4 + 3] = (byte)(j & 0x000000FF);
477        }        }
478    
479      return(new CollationKey(this, str, key));      return(new CollationKey(this, str, key));

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