object NumericChar

The companion object for NumericChar that offers factory methods that produce NumericChars and maximum and minimum constant values for NumericChar.

Source
NumericChar.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NumericChar
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final val MaxValue: NumericChar

    The largest value representable as a NumericChar.

  5. final val MinValue: NumericChar

    The smallest value representable as a NumericChar.

  6. implicit macro def apply(value: Char): NumericChar

    A factory method, implemented via a macro, that produces a NumericChar if passed a valid Char literal, otherwise a compile time error.

    A factory method, implemented via a macro, that produces a NumericChar if passed a valid Char literal, otherwise a compile time error.

    The macro that implements this method will inspect the specified Char expression at compile time. If the expression is a numeric Char literal, i.e., a value between '0' and '9', it will return a NumericChar representing that value. Otherwise, the passed Char expression is either a literal that is not numeric, or is not a literal, so this method will give a compiler error.

    This factory method differs from the from factory method in that this method is implemented via a macro that inspects Char literals at compile time, whereas from inspects Char values at run time.

    value

    the Char literal expression to inspect at compile time, and if numeric, to return wrapped in a NumericChar at run time.

    returns

    the specified, valid Char literal value wrapped in a NumericChar. (If the specified expression is not a valid Char literal, the invocation of this method will not compile.)

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def ensuringValid(value: Char): NumericChar

    A factory/assertion method that produces a NumericChar given a valid Char value, or throws AssertionError, if given an invalid Char value.

    A factory/assertion method that produces a NumericChar given a valid Char value, or throws AssertionError, if given an invalid Char value.

    Note: you should use this method only when you are convinced that it will always succeed, i.e., never throw an exception. It is good practice to add a comment near the invocation of this method indicating why you think it will always succeed to document your reasoning. If you are not sure an ensuringValid call will always succeed, you should use one of the other factory or validation methods provided on this object instead: isValid, tryingValid, passOrElse, goodOrElse, or rightOrElse.

    This method will inspect the passed Char value and if it is a numeric Char, it will return a NumericChar representing that value. Otherwise, the passed Char value is not numeric, so this method will throw AssertionError.

    This factory method differs from the apply factory method in that apply is implemented via a macro that inspects Char literals at compile time, whereas this method inspects Char values at run time. It differs from a vanilla assert or ensuring call in that you get something you didn't already have if the assertion succeeds: a type that promises a Char is numeric.

    value

    the Char to inspect, and if numeric, return wrapped in a NumericChar.

    returns

    the specified Char value wrapped in a NumericChar, if it is numeric, else throws AssertionError.

    Exceptions thrown

    AssertionError if the passed value is not numeric

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. def from(value: Char): Option[NumericChar]

    A factory method that produces an Option[NumericChar] given a Char value.

    A factory method that produces an Option[NumericChar] given a Char value.

    This method will inspect the passed Char value and if it is a numeric Char, i.e., between '0' and '9', it will return a NumericChar representing that value, wrapped in a Some. Otherwise, the passed Char value is not a numeric character value, so this method will return None.

    This factory method differs from the apply factory method in that apply is implemented via a macro that inspects Char literals at compile time, whereas from inspects Char values at run time.

    value

    the Char to inspect, and if numeric, return wrapped in a Some[NumericChar].

    returns

    the specified Char value wrapped in a Some[NumericChar], if it is numeric, else None.

  14. def fromOrElse(value: Char, default: => NumericChar): NumericChar

    A factory method that produces a NumericChar given a Char value and a default NumericChar.

    A factory method that produces a NumericChar given a Char value and a default NumericChar.

    This method will inspect the passed Char value and if it is a valid numeric Char (between '0' and '9'), it will return a NumericChar representing that value. Otherwise, the passed Char value is a non-digit character, so this method will return the passed default value.

    This factory method differs from the apply factory method in that apply is implemented via a macro that inspects Char literals at compile time, whereas fromOrElse inspects Char values at run time.

    value

    the Char to inspect, and if numeric, return.

    default

    the NumericChar to return if the passed Char value is not numeric.

    returns

    the specified Char value wrapped in a NumericChar, if it is numeric, else the default NumericChar value.

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def goodOrElse[B](value: Char)(f: (Char) => B): Or[NumericChar, B]

    A factory/validation method that produces a NumericChar, wrapped in a Good, given a valid Char value, or if the given Char is invalid, an error value of type B produced by passing the given invalid Char value to the given function f, wrapped in a Bad.

    A factory/validation method that produces a NumericChar, wrapped in a Good, given a valid Char value, or if the given Char is invalid, an error value of type B produced by passing the given invalid Char value to the given function f, wrapped in a Bad.

    This method will inspect the passed Char value and if it is a numeric Char, it will return a NumericChar representing that value, wrapped in a Good. Otherwise, the passed Char value is NOT numeric, so this method will return a result of type B obtained by passing the invalid Char value to the given function f, wrapped in a Bad.

    This factory method differs from the apply factory method in that apply is implemented via a macro that inspects Char literals at compile time, whereas this method inspects Char values at run time.

    value

    the Char to inspect, and if numeric, return wrapped in a Good(NumericChar).

    returns

    the specified Char value wrapped in a Good(NumericChar), if it is numeric, else a Bad(f(value)).

  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def isValid(value: Char): Boolean

    A predicate method that returns true if a given Char value is between '0' and '9'.

    A predicate method that returns true if a given Char value is between '0' and '9'.

    value

    the Char to inspect, and if numeric, return true.

    returns

    true if the specified Char is numeric, else false.

  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def passOrElse[E](value: Char)(f: (Char) => E): Validation[E]

    A validation method that produces a Pass given a valid Char value, or an error value of type E produced by passing the given invalid Char value to the given function f, wrapped in a Fail.

    A validation method that produces a Pass given a valid Char value, or an error value of type E produced by passing the given invalid Char value to the given function f, wrapped in a Fail.

    This method will inspect the passed Char value and if it is a numeric Char (between '0' and '9'), it will return a Pass. Otherwise, the passed Char value is non-numeric, so this method will return a result of type E obtained by passing the invalid Char value to the given function f, wrapped in a Fail.

    This factory method differs from the apply factory method in that apply is implemented via a macro that inspects Char literals at compile time, whereas this method inspects Char values at run time.

    value

    the Char to validate that it is numeric.

    returns

    a Pass if the specified Char value is numeric, else a Fail containing an error value produced by passing the specified Char to the given function f.

  24. def rightOrElse[L](value: Char)(f: (Char) => L): Either[L, NumericChar]

    A factory/validation method that produces a NumericChar, wrapped in a Right, given a valid Char value, or if the given Char is invalid, an error value of type L produced by passing the given invalid Char value to the given function f, wrapped in a Left.

    A factory/validation method that produces a NumericChar, wrapped in a Right, given a valid Char value, or if the given Char is invalid, an error value of type L produced by passing the given invalid Char value to the given function f, wrapped in a Left.

    This method will inspect the passed Char value and if it is a numeric Char (between '0' and '9'), it will return a NumericChar representing that value, wrapped in a Right. Otherwise, the passed Char value is NOT numeric, so this method will return a result of type L obtained by passing the invalid Char value to the given function f, wrapped in a Left.

    This factory method differs from the apply factory method in that apply is implemented via a macro that inspects Char literals at compile time, whereas this method inspects Char values at run time.

    value

    the Char to inspect, and if numeric, return wrapped in a Right(NumericChar).

    returns

    the specified Char value wrapped in a Right(NumericChar), if it is numeric, else a Left(f(value)).

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. def tryingValid(value: Char): Try[NumericChar]

    A factory/validation method that produces a NumericChar, wrapped in a Success, given a valid Char value, or if the given Char is invalid, an AssertionError, wrapped in a Failure.

    A factory/validation method that produces a NumericChar, wrapped in a Success, given a valid Char value, or if the given Char is invalid, an AssertionError, wrapped in a Failure.

    This method will inspect the passed Char value and if it represents a numeric value (between '0' and '9'), it will return a NumericChar representing that value, wrapped in a Success. Otherwise, the passed Char value is not numeric, so this method will return an AssertionError, wrapped in a Failure.

    This factory method differs from the apply factory method in that apply is implemented via a macro that inspects Char literals at compile time, whereas this method inspects Char values at run time.

    value

    the Char to inspect, and if numeric, return wrapped in a Success(NumericChar).

    returns

    the specified Char value wrapped in a Success(NumericChar), if it is numeric, else a Failure(AssertionError).

  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. implicit def widenToDouble(value: NumericChar): Double

    Implicit widening conversion from NumericChar to Double.

    Implicit widening conversion from NumericChar to Double.

    value

    the NumericChar to widen

    returns

    the Double widen from the specified NumericChar.

  32. implicit def widenToFiniteDouble(pos: NumericChar): FiniteDouble

    Implicit widening conversion from NumericChar to FiniteDouble.

    Implicit widening conversion from NumericChar to FiniteDouble.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Double and wrapped in a FiniteDouble.

  33. implicit def widenToFiniteFloat(pos: NumericChar): FiniteFloat

    Implicit widening conversion from NumericChar to FiniteFloat.

    Implicit widening conversion from NumericChar to FiniteFloat.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Float and wrapped in a FiniteFloat.

  34. implicit def widenToFloat(value: NumericChar): Float

    Implicit widening conversion from NumericChar to Float.

    Implicit widening conversion from NumericChar to Float.

    value

    the NumericChar to widen

    returns

    the Float widen from the specified NumericChar.

  35. implicit def widenToInt(value: NumericChar): Int

    Implicit widening conversion from NumericChar to Int.

    Implicit widening conversion from NumericChar to Int.

    value

    the NumericChar to widen

    returns

    the Int widen from the specified NumericChar.

  36. implicit def widenToLong(value: NumericChar): Long

    Implicit widening conversion from NumericChar to Long.

    Implicit widening conversion from NumericChar to Long.

    value

    the NumericChar to widen

    returns

    the Long widen from the specified NumericChar.

  37. implicit def widenToPosDouble(pos: NumericChar): PosDouble

    Implicit widening conversion from NumericChar to PosDouble.

    Implicit widening conversion from NumericChar to PosDouble.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Double and wrapped in a PosDouble.

  38. implicit def widenToPosFiniteDouble(pos: NumericChar): PosFiniteDouble

    Implicit widening conversion from NumericChar to PosFiniteDouble.

    Implicit widening conversion from NumericChar to PosFiniteDouble.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Double and wrapped in a PosFiniteDouble.

  39. implicit def widenToPosFiniteFloat(pos: NumericChar): PosFiniteFloat

    Implicit widening conversion from NumericChar to PosFiniteFloat.

    Implicit widening conversion from NumericChar to PosFiniteFloat.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Float and wrapped in a PosFiniteFloat.

  40. implicit def widenToPosFloat(pos: NumericChar): PosFloat

    Implicit widening conversion from NumericChar to PosFloat.

    Implicit widening conversion from NumericChar to PosFloat.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Float and wrapped in a PosFloat.

  41. implicit def widenToPosInt(pos: NumericChar): PosInt

    Implicit widening conversion from NumericChar to PosInt.

    Implicit widening conversion from NumericChar to PosInt.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Int and wrapped in a PosInt.

  42. implicit def widenToPosLong(pos: NumericChar): PosLong

    Implicit widening conversion from NumericChar to PosLong.

    Implicit widening conversion from NumericChar to PosLong.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Long and wrapped in a PosLong.

  43. implicit def widenToPosZDouble(pos: NumericChar): PosZDouble

    Implicit widening conversion from NumericChar to PosZDouble.

    Implicit widening conversion from NumericChar to PosZDouble.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Double and wrapped in a PosZDouble.

  44. implicit def widenToPosZFiniteDouble(pos: NumericChar): PosZFiniteDouble

    Implicit widening conversion from NumericChar to PosZFiniteDouble.

    Implicit widening conversion from NumericChar to PosZFiniteDouble.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Double and wrapped in a PosZFiniteDouble.

  45. implicit def widenToPosZFiniteFloat(pos: NumericChar): PosZFiniteFloat

    Implicit widening conversion from NumericChar to PosZFiniteFloat.

    Implicit widening conversion from NumericChar to PosZFiniteFloat.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Float and wrapped in a PosZFiniteFloat.

  46. implicit def widenToPosZFloat(pos: NumericChar): PosZFloat

    Implicit widening conversion from NumericChar to PosZFloat.

    Implicit widening conversion from NumericChar to PosZFloat.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Float and wrapped in a PosZFloat.

  47. implicit def widenToPosZInt(pos: NumericChar): PosZInt

    Implicit widening conversion from NumericChar to PosZInt.

    Implicit widening conversion from NumericChar to PosZInt.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Int and wrapped in a PosZInt.

  48. implicit def widenToPosZLong(pos: NumericChar): PosZLong

    Implicit widening conversion from NumericChar to PosZLong.

    Implicit widening conversion from NumericChar to PosZLong.

    pos

    the NumericChar to widen

    returns

    the Int value underlying the specified NumericChar, widened to Long and wrapped in a PosZLong.

Inherited from AnyRef

Inherited from Any

Ungrouped