summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-09-18 20:37:52 +0000
committerPaul Phillips <paulp@improving.org>2009-09-18 20:37:52 +0000
commitacf1e47be8f8d7cabcb900c56a0e1ae7c0d8c1e1 (patch)
treee380448e5695a0b9659819644c00ff6e72d8ec8e
parent03570027fe92307c20584cc8a6c33057a903f7f3 (diff)
downloadscala-acf1e47be8f8d7cabcb900c56a0e1ae7c0d8c1e1.tar.gz
scala-acf1e47be8f8d7cabcb900c56a0e1ae7c0d8c1e1.tar.bz2
scala-acf1e47be8f8d7cabcb900c56a0e1ae7c0d8c1e1.zip
Exposed a bunch of java 5 Character methods thr...
Exposed a bunch of java 5 Character methods through RichChar, and deprecated a couple in favor of less irritating names.
-rw-r--r--src/library/scala/runtime/RichChar.scala39
1 files changed, 35 insertions, 4 deletions
diff --git a/src/library/scala/runtime/RichChar.scala b/src/library/scala/runtime/RichChar.scala
index cbc8f88ab0..e79984c5a7 100644
--- a/src/library/scala/runtime/RichChar.scala
+++ b/src/library/scala/runtime/RichChar.scala
@@ -46,12 +46,43 @@ final class RichChar(x: Char) extends Proxy with Ordered[Char] {
def isDigit: Boolean = Character.isDigit(x)
def isLetter: Boolean = Character.isLetter(x)
def isLetterOrDigit: Boolean = Character.isLetterOrDigit(x)
- def isLowerCase: Boolean = Character.isLowerCase(x)
- def isUpperCase: Boolean = Character.isUpperCase(x)
def isWhitespace: Boolean = Character.isWhitespace(x)
+ def isSpaceChar: Boolean = Character.isSpaceChar(x)
+ def isHighSurrogate: Boolean = Character.isHighSurrogate(x)
+ def isLowSurrogate: Boolean = Character.isLowSurrogate(x)
+ def isUnicodeIdentifierStart: Boolean = Character.isUnicodeIdentifierStart(x)
+ def isUnicodeIdentifierPart: Boolean = Character.isUnicodeIdentifierPart(x)
+ def isIdentifierIgnorable: Boolean = Character.isIdentifierIgnorable(x)
+ def isMirrored: Boolean = Character.isMirrored(x)
- def toLowerCase: Char = Character.toLowerCase(x)
- def toUpperCase: Char = Character.toUpperCase(x)
+ def isLower: Boolean = Character.isLowerCase(x)
+ def isUpper: Boolean = Character.isUpperCase(x)
+ def isTitleCase: Boolean = Character.isTitleCase(x)
+
+ def toLower: Char = Character.toLowerCase(x)
+ def toUpper: Char = Character.toUpperCase(x)
+ def toTitleCase: Char = Character.toTitleCase(x)
+
+ def getType: Int = Character.getType(x)
+ def getNumericValue: Int = Character.getNumericValue(x)
+ def getDirectionality: Byte = Character.getDirectionality(x)
+ def reverseBytes: Char = Character.reverseBytes(x)
+
+ // Java 5 Character methods not added:
+ //
+ // public static boolean isDefined(char ch)
+ // public static boolean isJavaIdentifierStart(char ch)
+ // public static boolean isJavaIdentifierPart(char ch)
+
+ @deprecated("Use ch.toLower instead")
+ def toLowerCase: Char = toLower
+ @deprecated("Use ch.toUpper instead")
+ def toUpperCase: Char = toUpper
+
+ @deprecated("Use ch.isLower instead")
+ def isLowerCase: Boolean = isLower
+ @deprecated("Use ch.isUpper instead")
+ def isUpperCase: Boolean = isUpper
/** Create a <code>[Char]</code> over the characters from 'x' to 'y' - 1
*/