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

Diff of /classpath/java/lang/Character.java

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

revision 1.24 by ericb, Mon Feb 25 20:02:58 2002 UTC revision 1.25 by ericb, Sat Mar 9 04:01:12 2002 UTC
# Line 1422  public final class Character implements Line 1422  public final class Character implements
1422     * of String.value to avoid copying the array.     * of String.value to avoid copying the array.
1423     * @see CharData#DIRECTION     * @see CharData#DIRECTION
1424     */     */
1425    private static final char[] direction = CharData.DIRECTION.value;    // Package visible for use by String.
1426      static final char[] direction = CharData.DIRECTION.value;
1427    
1428    /**    /**
1429     * Stores unicode titlecase table. Exploit package visibility of     * Stores unicode titlecase table. Exploit package visibility of
# Line 1461  public final class Character implements Line 1462  public final class Character implements
1462     * @see CharData#DATA     * @see CharData#DATA
1463     * @see CharData#SHIFT     * @see CharData#SHIFT
1464     */     */
1465    private static char readChar(char ch)    // Package visible for use in String.
1466      static char readChar(char ch)
1467    {    {
1468      // Perform 16-bit addition to find the correct entry in data.      // Perform 16-bit addition to find the correct entry in data.
1469      return data[(char) (blocks[ch >> CharData.SHIFT] + ch)];      return data[(char) (blocks[ch >> CharData.SHIFT] + ch)];
# Line 1518  public final class Character implements Line 1520  public final class Character implements
1520     */     */
1521    public String toString()    public String toString()
1522    {    {
1523      // This assumes that String.valueOf(char) can create a single-character      // Package constructor avoids an array copy.
1524      // String more efficiently than through the public API.      return new String(new char[] { value }, 1);
     return String.valueOf(value);  
1525    }    }
1526    
1527    /**    /**
# Line 1532  public final class Character implements Line 1533  public final class Character implements
1533     */     */
1534    public String toString(char ch)    public String toString(char ch)
1535    {    {
1536      // This assumes that String.valueOf(char) can create a single-character      // Package constructor avoids an array copy.
1537      // String more efficiently than through the public API.      return new String(new char[] { value }, 1);
     return String.valueOf(ch);  
1538    }    }
1539    
1540    /**    /**
# Line 2195  public final class Character implements Line 2195  public final class Character implements
2195    public static byte getDirectionality(char ch)    public static byte getDirectionality(char ch)
2196    {    {
2197      // The result will correctly be signed.      // The result will correctly be signed.
2198      return (byte) direction[readChar(ch) >> 7];      return (byte) (direction[readChar(ch) >> 7] >> 2);
2199    }    }
2200    
2201    /**    /**

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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