harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r425695 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
Date Wed, 26 Jul 2006 10:06:30 GMT
Author: pyang
Date: Wed Jul 26 03:06:28 2006
New Revision: 425695

URL: http://svn.apache.org/viewvc?rev=425695&view=rev
Log:
Fix for HARMONY-983 (Implementation of Character.reverseBytes & Character.isISOControl(int)
methods)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java?rev=425695&r1=425694&r2=425695&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
Wed Jul 26 03:06:28 2006
@@ -2559,6 +2559,18 @@
 	 *         character, otherwise <code>false</code>
 	 */
 	public static boolean isISOControl(char c) {
+		return isISOControl((int)c);
+	}
+
+	/**
+	 * Answers whether the character is an ISO control character.
+	 * 
+	 * @param c
+	 *            the character,, including supplementary characters
+	 * @return <code>true</code> if <code>c</code> is an ISO control
+	 *         character, otherwise <code>false</code>
+	 */
+	public static boolean isISOControl(int c) {
 		return (c >= 0 && c <= 0x1f) || (c >= 0x7f && c <= 0x9f);
 	}
 
@@ -2784,6 +2796,16 @@
 		if (c < 0x2000 || c == 0x2007)
 			return false;
 		return c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x3000;
+	}
+
+	/**
+	 * Reverse the order of the first and second bytes in character
+	 * @param c
+	 *            the character
+	 * @return    the character with reordered bytes.
+	 */
+	public static char reverseBytes(char c) {
+		return (char)((c<<8) | (c>>8));
 	}
 
 	/**



Mime
View raw message