59 |
* for more information on the Unicode Standard. |
* for more information on the Unicode Standard. |
60 |
* |
* |
61 |
* @author Paul N. Fisher |
* @author Paul N. Fisher |
62 |
|
* @author Jochen Hoenicke |
63 |
* @author Eric Blake <ebb9@email.byu.edu> |
* @author Eric Blake <ebb9@email.byu.edu> |
64 |
* @since 1.0 |
* @since 1.0 |
65 |
|
* @see CharData |
66 |
*/ |
*/ |
67 |
public final class Character implements Serializable, Comparable |
public final class Character implements Serializable, Comparable |
68 |
{ |
{ |
877 |
|
|
878 |
/** |
/** |
879 |
* Specials. |
* Specials. |
880 |
* '\uFFF0' - '\uFFFD'. |
* '\uFEFF', '\uFFF0' - '\uFFFD'. |
881 |
*/ |
*/ |
882 |
public final static UnicodeBlock SPECIALS |
public final static UnicodeBlock SPECIALS |
883 |
= new UnicodeBlock('\uFFF0', '\uFFFD', |
= new UnicodeBlock('\uFFF0', '\uFFFD', |
1433 |
*/ |
*/ |
1434 |
private static final int TYPE_MASK = 0x1F; |
private static final int TYPE_MASK = 0x1F; |
1435 |
|
|
1436 |
/** Mask for grabbing the non-breaking space flag out of the contents of |
/** |
1437 |
|
* Mask for grabbing the non-breaking space flag out of the contents of |
1438 |
* data. |
* data. |
1439 |
* @see CharData#DATA |
* @see CharData#DATA |
1440 |
*/ |
*/ |
1441 |
private static final int NO_BREAK_MASK = 0x20; |
private static final int NO_BREAK_MASK = 0x20; |
1442 |
|
|
1443 |
/** Mask for grabbing the mirrored directionality flag out of the contents |
/** |
1444 |
|
* Mask for grabbing the mirrored directionality flag out of the contents |
1445 |
* of data. |
* of data. |
1446 |
* @see CharData#DATA |
* @see CharData#DATA |
1447 |
*/ |
*/ |
1459 |
*/ |
*/ |
1460 |
private static char readChar(char ch) |
private static char readChar(char ch) |
1461 |
{ |
{ |
1462 |
return data[blocks[ch >> CharData.SHIFT] |
// Perform 16-bit addition to find the correct entry in data. |
1463 |
+ (ch & ~(-1 << CharData.SHIFT))]; |
return data[(char) (blocks[ch >> CharData.SHIFT] + ch)]; |
1464 |
} |
} |
1465 |
|
|
1466 |
/** |
/** |