/[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.30 by mark, Fri Jul 12 21:25:53 2002 UTC revision 1.31 by mark, Tue Aug 13 20:51:07 2002 UTC
# Line 1384  public final class Character implements Line 1384  public final class Character implements
1384    public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 18;    public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 18;
1385    
1386    /**    /**
1387       * Returns the value array of the given string if it is zero based or a
1388       * copy of it that is zero based (stripping offset and making length equal
1389       * to count). Used for accessing the char[]s of gnu.java.lang.CharData.
1390       * Package private for use in String.
1391       */
1392      static char[] zeroBasedStringValue(String s)
1393      {
1394        char[] value;
1395    
1396        if (s.offset == 0 && s.count == s.value.length)
1397          value = s.value;
1398        else
1399          {
1400            int count = s.count;
1401            value = new char[count];
1402            System.arraycopy(s.value, s.offset, value, 0, count);
1403          }
1404    
1405        return value;
1406      }
1407    
1408      /**
1409     * Stores unicode block offset lookup table. Exploit package visibility of     * Stores unicode block offset lookup table. Exploit package visibility of
1410     * String.value to avoid copying the array.     * String.value to avoid copying the array.
1411     * @see #readChar(char)     * @see #readChar(char)
1412     * @see CharData#BLOCKS     * @see CharData#BLOCKS
1413     */     */
1414    private static final char[] blocks = CharData.BLOCKS.value;    private static final char[] blocks = zeroBasedStringValue(CharData.BLOCKS);
1415    
1416    /**    /**
1417     * Stores unicode attribute offset lookup table. Exploit package visibility     * Stores unicode attribute offset lookup table. Exploit package visibility
1418     * of String.value to avoid copying the array.     * of String.value to avoid copying the array.
1419     * @see CharData#DATA     * @see CharData#DATA
1420     */     */
1421    private static final char[] data = CharData.DATA.value;    private static final char[] data = zeroBasedStringValue(CharData.DATA);
1422    
1423    /**    /**
1424     * Stores unicode numeric value attribute table. Exploit package visibility     * Stores unicode numeric value attribute table. Exploit package visibility
1425     * of String.value to avoid copying the array.     * of String.value to avoid copying the array.
1426     * @see CharData#NUM_VALUE     * @see CharData#NUM_VALUE
1427     */     */
1428    private static final char[] numValue = CharData.NUM_VALUE.value;    private static final char[] numValue
1429              = zeroBasedStringValue(CharData.NUM_VALUE);
1430    
1431    /**    /**
1432     * Stores unicode uppercase attribute table. Exploit package visibility     * Stores unicode uppercase attribute table. Exploit package visibility
1433     * of String.value to avoid copying the array.     * of String.value to avoid copying the array.
1434     * @see CharData#UPPER     * @see CharData#UPPER
1435     */     */
1436    private static final char[] upper = CharData.UPPER.value;    private static final char[] upper = zeroBasedStringValue(CharData.UPPER);
1437    
1438    /**    /**
1439     * Stores unicode lowercase attribute table. Exploit package visibility     * Stores unicode lowercase attribute table. Exploit package visibility
1440     * of String.value to avoid copying the array.     * of String.value to avoid copying the array.
1441     * @see CharData#LOWER     * @see CharData#LOWER
1442     */     */
1443    private static final char[] lower = CharData.LOWER.value;    private static final char[] lower = zeroBasedStringValue(CharData.LOWER);
1444    
1445    /**    /**
1446     * Stores unicode direction attribute table. Exploit package visibility     * Stores unicode direction attribute table. Exploit package visibility
# Line 1425  public final class Character implements Line 1448  public final class Character implements
1448     * @see CharData#DIRECTION     * @see CharData#DIRECTION
1449     */     */
1450    // Package visible for use by String.    // Package visible for use by String.
1451    static final char[] direction = CharData.DIRECTION.value;    static final char[] direction = zeroBasedStringValue(CharData.DIRECTION);
1452    
1453    /**    /**
1454     * Stores unicode titlecase table. Exploit package visibility of     * Stores unicode titlecase table. Exploit package visibility of
1455     * String.value to avoid copying the array.     * String.value to avoid copying the array.
1456     * @see CharData#TITLE     * @see CharData#TITLE
1457     */     */
1458    private static final char[] title = CharData.TITLE.value;    private static final char[] title = zeroBasedStringValue(CharData.TITLE);
1459    
1460    /**    /**
1461     * Mask for grabbing the type out of the contents of data.     * Mask for grabbing the type out of the contents of data.

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

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