diff options
author | mihaylov <mihaylov@epfl.ch> | 2006-11-01 19:03:27 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2006-11-01 19:03:27 +0000 |
commit | f187d8d4737064f063cc9fbc5b036979ecc8a40f (patch) | |
tree | ff2d0375ac4fc5d10b033e6fdcc8a999786f15e4 /src | |
parent | 4749c3d31d274c5d190d4e260692942717b6654a (diff) | |
download | scala-f187d8d4737064f063cc9fbc5b036979ecc8a40f.tar.gz scala-f187d8d4737064f063cc9fbc5b036979ecc8a40f.tar.bz2 scala-f187d8d4737064f063cc9fbc5b036979ecc8a40f.zip |
Committed my original version of RichChar
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/compat/Platform.scala | 1 | ||||
-rw-r--r-- | src/library/scala/runtime/RichChar.scala | 18 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/library/scala/compat/Platform.scala b/src/library/scala/compat/Platform.scala index fa32f93a72..43c5c22498 100644 --- a/src/library/scala/compat/Platform.scala +++ b/src/library/scala/compat/Platform.scala @@ -53,5 +53,4 @@ object Platform { def currentTime: Long = System.currentTimeMillis() def collectGarbage: Unit = System.gc() - //def isDigit(c: Char): Boolean = java.lang.Character.isDigit(c); } diff --git a/src/library/scala/runtime/RichChar.scala b/src/library/scala/runtime/RichChar.scala index 7badbe0f39..4e7a4752f7 100644 --- a/src/library/scala/runtime/RichChar.scala +++ b/src/library/scala/runtime/RichChar.scala @@ -8,27 +8,25 @@ // $Id$ + package scala.runtime -import Predef._ + +import java.lang.Character final class RichChar(c: Char) { - def asDigit: Int = Character.digit(c, 10) - def isControl: Boolean = Character.isISOControl(c) + def isWhitespace: Boolean = Character.isWhitespace(c) def isDigit: Boolean = Character.isDigit(c) - def isISOControl: Boolean = Character.isISOControl(c) def isLetter: Boolean = Character.isLetter(c) def isLetterOrDigit: Boolean = Character.isLetterOrDigit(c) def isLowerCase: Boolean = Character.isLowerCase(c) - def isSpaceChar: Boolean = Character.isSpaceChar(c) - def isTitleCase: Boolean = Character.isTitleCase(c) - def isUnicodeIdentifierPart: Boolean = Character.isUnicodeIdentifierPart(c) - def isUnicodeIdentifierStart: Boolean = Character.isUnicodeIdentifierStart(c) def isUpperCase: Boolean = Character.isUpperCase(c) - def isWhitespace: Boolean = Character.isWhitespace(c) + def isControl: Boolean = Character.isISOControl(c) def toLowerCase: Char = Character.toLowerCase(c) - def toTitleCase: Char = Character.toTitleCase(c) def toUpperCase: Char = Character.toUpperCase(c) + + def asDigit: Int = Character.digit(c, Character.MAX_RADIX) + } |