Imported Classpath 0.18.
* sources.am, Makefile.in: Updated. * Makefile.am (nat_source_files): Removed natProxy.cc. * java/lang/reflect/natProxy.cc: Removed. * gnu/classpath/jdwp/VMFrame.java, gnu/classpath/jdwp/VMIdManager.java, gnu/classpath/jdwp/VMVirtualMachine.java, java/lang/reflect/VMProxy.java: New files. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC list. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/net/DefaultContentHandlerFactory.java (getContent): Remove ClasspathToolkit references. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/awt/xlib/XCanvasPeer.java: Add new peer methods. * gnu/awt/xlib/XFramePeer.java: Likewise. * gnu/awt/xlib/XGraphicsConfiguration.java: Likewise. 2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com> * Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add classpath/native/jawt/jawt.c. * Makefile.in: Regenerate. * jawt.c: Remove file. * include/Makefile.am (tool_include__HEADERS): Remove jawt.h and jawt_md.h. Add ../classpath/include/jawt.h and ../classpath/include/jawt_md.h. * include/Makefile.in: Regenerate. * include/jawt.h: Regenerate. * include/jawt_md.h: Regenerate. From-SVN: r104586
This commit is contained in:
parent
9b044d1951
commit
1ea63ef8be
544 changed files with 34724 additions and 14512 deletions
|
@ -1456,6 +1456,57 @@ public final class Character implements Serializable, Comparable
|
|||
*/
|
||||
private static final int MIRROR_MASK = 0x40;
|
||||
|
||||
/**
|
||||
* Min value for supplementary code point.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final int MIN_SUPPLEMENTARY_CODE_POINT = 0x10000;
|
||||
|
||||
/**
|
||||
* Min value for code point.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final int MIN_CODE_POINT = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Max value for code point.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final int MAX_CODE_POINT = 0x010ffff;
|
||||
|
||||
|
||||
/**
|
||||
* Minimum high surrrogate code in UTF-16 encoding.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final char MIN_HIGH_SURROGATE = '\ud800';
|
||||
|
||||
/**
|
||||
* Maximum high surrrogate code in UTF-16 encoding.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final char MAX_HIGH_SURROGATE = '\udbff';
|
||||
|
||||
/**
|
||||
* Minimum low surrrogate code in UTF-16 encoding.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final char MIN_LOW_SURROGATE = '\udc00';
|
||||
|
||||
/**
|
||||
* Maximum low surrrogate code in UTF-16 encoding.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static final char MAX_LOW_SURROGATE = '\udfff';
|
||||
|
||||
/**
|
||||
* Grabs an attribute offset from the Unicode attribute database. The lower
|
||||
* 5 bits are the character type, the next 2 bits are flags, and the top
|
||||
|
@ -2250,4 +2301,118 @@ public final class Character implements Serializable, Comparable
|
|||
{
|
||||
return compareTo((Character) o);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a unicode code point to a UTF-16 representation of that
|
||||
* code point.
|
||||
*
|
||||
* @param codePoint the unicode code point
|
||||
*
|
||||
* @return the UTF-16 representation of that code point
|
||||
*
|
||||
* @throws IllegalArgumentException if the code point is not a valid
|
||||
* unicode code point
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static char[] toChars(int codePoint)
|
||||
{
|
||||
char[] result = new char[charCount(codePoint)];
|
||||
int ignore = toChars(codePoint, result, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a unicode code point to its UTF-16 representation.
|
||||
*
|
||||
* @param codePoint the unicode code point
|
||||
* @param dst the target char array
|
||||
* @param dstIndex the start index for the target
|
||||
*
|
||||
* @return number of characters written to <code>dst</code>
|
||||
*
|
||||
* @throws IllegalArgumentException if <code>codePoint</code> is not a
|
||||
* valid unicode code point
|
||||
* @throws NullPointerException if <code>dst</code> is <code>null</code>
|
||||
* @throws IndexOutOfBoundsException if <code>dstIndex</code> is not valid
|
||||
* in <code>dst</code> or if the UTF-16 representation does not
|
||||
* fit into <code>dst</code>
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static int toChars(int codePoint, char[] dst, int dstIndex)
|
||||
{
|
||||
if (!isValidCodePoint(codePoint))
|
||||
{
|
||||
throw new IllegalArgumentException("not a valid code point: "
|
||||
+ codePoint);
|
||||
}
|
||||
|
||||
int result;
|
||||
if (isSupplementaryCodePoint(codePoint))
|
||||
{
|
||||
// Write second char first to cause IndexOutOfBoundsException
|
||||
// immediately.
|
||||
dst[dstIndex + 1] = (char) ((codePoint & 0x3ff)
|
||||
+ (int) MIN_LOW_SURROGATE );
|
||||
dst[dstIndex] = (char) ((codePoint >> 10) + (int) MIN_HIGH_SURROGATE);
|
||||
result = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
dst[dstIndex] = (char) codePoint;
|
||||
result = 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of 16-bit characters required to represent the given
|
||||
* code point.
|
||||
*
|
||||
* @param codePoint a uncode code point
|
||||
*
|
||||
* @return 2 if codePoint >= 0x10000, 1 otherwise.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static int charCount(int codePoint)
|
||||
{
|
||||
return
|
||||
(codePoint >= MIN_SUPPLEMENTARY_CODE_POINT)
|
||||
? 2
|
||||
: 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the specified code point is
|
||||
* in the range 0x10000 .. 0x10FFFF, i.e. the character is within the Unicode
|
||||
* supplementary character range.
|
||||
*
|
||||
* @param codePoint a Unicode code point
|
||||
*
|
||||
* @return <code>true</code> if code point is in supplementary range
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static boolean isSupplementaryCodePoint(int codePoint)
|
||||
{
|
||||
return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT
|
||||
&& codePoint <= MAX_CODE_POINT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the specified code point is
|
||||
* in the range 0x0000 .. 0x10FFFF, i.e. it is a valid Unicode code point.
|
||||
*
|
||||
* @param codePoint a Unicode code point
|
||||
*
|
||||
* @return <code>true</code> if code point is valid
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static boolean isValidCodePoint(int codePoint)
|
||||
{
|
||||
return codePoint >= MIN_CODE_POINT && codePoint <= MAX_CODE_POINT;
|
||||
}
|
||||
} // class Character
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue