/[classpath]/classpath/java/lang/String.java
ViewVC logotype

Diff of /classpath/java/lang/String.java

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

revision 1.51 by ericb, Mon Sep 16 13:31:08 2002 UTC revision 1.52 by mark, Thu Oct 3 17:26:44 2002 UTC
# Line 99  public final class String implements Ser Line 99  public final class String implements Ser
99     * @see CharData#UPPER_EXPAND     * @see CharData#UPPER_EXPAND
100     */     */
101    private static final char[] upperExpand    private static final char[] upperExpand
102          = Character.zeroBasedStringValue(CharData.UPPER_EXPAND);          = zeroBasedStringValue(CharData.UPPER_EXPAND);
103    
104    /**    /**
105     * Stores unicode multi-character uppercase special casing table.     * Stores unicode multi-character uppercase special casing table.
# Line 107  public final class String implements Ser Line 107  public final class String implements Ser
107     * @see CharData#UPPER_SPECIAL     * @see CharData#UPPER_SPECIAL
108     */     */
109    private static final char[] upperSpecial    private static final char[] upperSpecial
110            = Character.zeroBasedStringValue(CharData.UPPER_SPECIAL);            = zeroBasedStringValue(CharData.UPPER_SPECIAL);
111        
112    /**    /**
113     * Characters which make up the String.     * Characters which make up the String.
# Line 1669  public final class String implements Ser Line 1669  public final class String implements Ser
1669        }        }
1670      return upperSpecial[mid + 1];      return upperSpecial[mid + 1];
1671    }    }
1672    
1673      /**
1674       * Returns the value array of the given string if it is zero based or a
1675       * copy of it that is zero based (stripping offset and making length equal
1676       * to count). Used for accessing the char[]s of gnu.java.lang.CharData.
1677       * Package private for use in Character.
1678       */
1679      static char[] zeroBasedStringValue(String s)
1680      {
1681        char[] value;
1682    
1683        if (s.offset == 0 && s.count == s.value.length)
1684          value = s.value;
1685        else
1686          {
1687            int count = s.count;
1688            value = new char[count];
1689            System.arraycopy(s.value, s.offset, value, 0, count);
1690          }
1691    
1692        return value;
1693      }
1694  } // class String  } // class String

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

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