scala.runtime.RichChar

final class RichChar extends AnyVal with IntegralProxy[Char]

Type Members

type ResultWithoutStep = NumericRange[Char]

  • Definition Classes
    • IntegralProxy → RangedProxy

Value Members From scala.Any

final def ##(): Int

Equivalent to x.hashCode except for boxed numeric types and null . For numerics, it returns a hash value which is consistent with value equality: if two value type instances compare as true, then ## will produce the same hash value for each of them. For null returns a hashcode where null.hashCode throws a NullPointerException .

  • returns
    • a hash value consistent with ==
  • Definition Classes
    • Any

(defined at scala.Any###)

Value Members From scala.math.Ordered

def <(that: Char): Boolean

Returns true if this is less than that

  • Definition Classes
    • Ordered

(defined at scala.math.Ordered)

def <=(that: Char): Boolean

Returns true if this is less than or equal to that .

  • Definition Classes
    • Ordered

(defined at scala.math.Ordered)

def >(that: Char): Boolean

Returns true if this is greater than that .

  • Definition Classes
    • Ordered

(defined at scala.math.Ordered)

def >=(that: Char): Boolean

Returns true if this is greater than or equal to that .

  • Definition Classes
    • Ordered

(defined at scala.math.Ordered)

def compareTo(that: Char): Int

Result of comparing this with operand that .

  • Definition Classes
    • Ordered → Comparable

(defined at scala.math.Ordered)

Value Members From scala.math.ScalaNumericAnyConversions

def unifiedPrimitiveEquals(x: Any): Boolean

Should only be called after all known non-primitive types have been excluded. This method won’t dispatch anywhere else after checking against the primitives to avoid infinite recursion between equals and this on unknown “Number” variants.

Additionally, this should only be called if the numeric type is happy to be converted to Long, Float, and Double. If for instance a BigInt much larger than the Long range is sent here, it will claim equality with whatever Long is left in its lower 64 bits. Or a BigDecimal with more precision than Double can hold: same thing. There’s no way given the interface available here to prevent this error.

  • Attributes
    • protected
  • Definition Classes
    • ScalaNumericAnyConversions

(defined at scala.math.ScalaNumericAnyConversions)

Value Members From scala.runtime.IntegralProxy

def to(end: Char): Inclusive[Char]

  • Definition Classes
    • IntegralProxy → RangedProxy

(defined at scala.runtime.IntegralProxy)

def to(end: Char, step: Char): Inclusive[Char]

  • Definition Classes
    • IntegralProxy → RangedProxy

(defined at scala.runtime.IntegralProxy)

def until(end: Char): Exclusive[Char]

  • Definition Classes
    • IntegralProxy → RangedProxy

(defined at scala.runtime.IntegralProxy)

def until(end: Char, step: Char): Exclusive[Char]

  • Definition Classes
    • IntegralProxy → RangedProxy

(defined at scala.runtime.IntegralProxy)

Value Members From scala.runtime.OrderedProxy

def compare(y: Char): Int

Result of comparing this with operand that .

Implement this method to determine how instances of A will be sorted.

Returns x where:

  • x < 0 when this < that
  • x == 0 when this == that
  • x > 0 when this > that

  • Definition Classes
    • OrderedProxy → Ordered

(defined at scala.runtime.OrderedProxy)

Instance Constructors From scala.runtime.RichChar

new RichChar(self: Char)

(defined at scala.runtime.RichChar)

Value Members From scala.runtime.RichChar

def max(that: Char): Char

Returns this if this > that or that otherwise.

  • Definition Classes
    • RichChar → ScalaNumberProxy

(defined at scala.runtime.RichChar)

def min(that: Char): Char

Returns this if this < that or that otherwise.

  • Definition Classes
    • RichChar → ScalaNumberProxy

(defined at scala.runtime.RichChar)

def num: CharIsIntegral.type

  • Attributes
    • protected
  • Definition Classes
    • RichChar → IntegralProxy → ScalaNumberProxy (defined at scala.runtime.RichChar)

Full Source:

/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2006-2013, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

package scala
package runtime


import java.lang.Character

final class RichChar(val self: Char) extends AnyVal with IntegralProxy[Char] {
  protected def num = scala.math.Numeric.CharIsIntegral
  protected def ord = scala.math.Ordering.Char

  override def doubleValue() = self.toDouble
  override def floatValue()  = self.toFloat
  override def longValue()   = self.toLong
  override def intValue()    = self.toInt
  override def byteValue()   = self.toByte
  override def shortValue()  = self.toShort

  override def isValidChar   = true

  override def abs: Char             = self
  override def max(that: Char): Char = math.max(self.toInt, that.toInt).toChar
  override def min(that: Char): Char = math.min(self.toInt, that.toInt).toChar
  override def signum: Int           = math.signum(self.toInt)

  def asDigit: Int                      = Character.digit(self, Character.MAX_RADIX)

  def isControl: Boolean                = Character.isISOControl(self)
  def isDigit: Boolean                  = Character.isDigit(self)
  def isLetter: Boolean                 = Character.isLetter(self)
  def isLetterOrDigit: Boolean          = Character.isLetterOrDigit(self)
  def isWhitespace: Boolean             = Character.isWhitespace(self)
  def isSpaceChar: Boolean              = Character.isSpaceChar(self)
  def isHighSurrogate: Boolean          = Character.isHighSurrogate(self)
  def isLowSurrogate: Boolean           = Character.isLowSurrogate(self)
  def isSurrogate: Boolean              = isHighSurrogate || isLowSurrogate
  def isUnicodeIdentifierStart: Boolean = Character.isUnicodeIdentifierStart(self)
  def isUnicodeIdentifierPart: Boolean  = Character.isUnicodeIdentifierPart(self)
  def isIdentifierIgnorable: Boolean    = Character.isIdentifierIgnorable(self)
  def isMirrored: Boolean               = Character.isMirrored(self)

  def isLower: Boolean                  = Character.isLowerCase(self)
  def isUpper: Boolean                  = Character.isUpperCase(self)
  def isTitleCase: Boolean              = Character.isTitleCase(self)

  def toLower: Char                     = Character.toLowerCase(self)
  def toUpper: Char                     = Character.toUpperCase(self)
  def toTitleCase: Char                 = Character.toTitleCase(self)

  def getType: Int                      = Character.getType(self)
  def getNumericValue: Int              = Character.getNumericValue(self)
  def getDirectionality: Byte           = Character.getDirectionality(self)
  def reverseBytes: Char                = Character.reverseBytes(self)

  // Java 5 Character methods not added:
  //
  // public static boolean isDefined(char ch)
  // public static boolean isJavaIdentifierStart(char ch)
  // public static boolean isJavaIdentifierPart(char ch)
}