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
- Alphabetic
- By Inheritance
- NumericChar
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
-   final  def !=(arg0: Any): Boolean- Definition Classes
- AnyRef → Any
 
-   final  def ##: Int- Definition Classes
- AnyRef → Any
 
-   final  def ==(arg0: Any): Boolean- Definition Classes
- AnyRef → Any
 
-   final  val MaxValue: NumericCharThe largest value representable as a NumericChar. 
-   final  val MinValue: NumericCharThe smallest value representable as a NumericChar. 
-   implicit macro  def apply(value: Char): NumericCharA factory method, implemented via a macro, that produces a NumericCharif passed a validCharliteral, otherwise a compile time error.A factory method, implemented via a macro, that produces a NumericCharif passed a validCharliteral, otherwise a compile time error.The macro that implements this method will inspect the specified Charexpression at compile time. If the expression is a numericCharliteral, i.e., a value between '0' and '9', it will return aNumericCharrepresenting that value. Otherwise, the passedCharexpression 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 fromfactory method in that this method is implemented via a macro that inspectsCharliterals at compile time, whereasfrominspectsCharvalues at run time.- value
- the - Charliteral expression to inspect at compile time, and if numeric, to return wrapped in a- NumericCharat run time.
- returns
- the specified, valid - Charliteral value wrapped in a- NumericChar. (If the specified expression is not a valid- Charliteral, the invocation of this method will not compile.)
 
-   final  def asInstanceOf[T0]: T0- Definition Classes
- Any
 
-    def clone(): AnyRef- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
 
-    def ensuringValid(value: Char): NumericCharA factory/assertion method that produces a NumericChargiven a validCharvalue, or throwsAssertionError, if given an invalidCharvalue.A factory/assertion method that produces a NumericChargiven a validCharvalue, or throwsAssertionError, if given an invalidCharvalue.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 ensuringValidcall will always succeed, you should use one of the other factory or validation methods provided on this object instead:isValid,tryingValid,passOrElse,goodOrElse, orrightOrElse.This method will inspect the passed Charvalue and if it is a numericChar, it will return aNumericCharrepresenting that value. Otherwise, the passedCharvalue is not numeric, so this method will throwAssertionError.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsCharliterals at compile time, whereas this method inspectsCharvalues at run time. It differs from a vanillaassertorensuringcall in that you get something you didn't already have if the assertion succeeds: a type that promises aCharis numeric.- value
- the - Charto inspect, and if numeric, return wrapped in a- NumericChar.
- returns
- the specified - Charvalue wrapped in a- NumericChar, if it is numeric, else throws- AssertionError.
 - Exceptions thrown
- AssertionErrorif the passed value is not numeric
 
-   final  def eq(arg0: AnyRef): Boolean- Definition Classes
- AnyRef
 
-    def equals(arg0: AnyRef): Boolean- Definition Classes
- AnyRef → Any
 
-    def finalize(): Unit- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
 
-    def from(value: Char): Option[NumericChar]A factory method that produces an Option[NumericChar]given aCharvalue.A factory method that produces an Option[NumericChar]given aCharvalue.This method will inspect the passed Charvalue and if it is a numericChar, i.e., between '0' and '9', it will return aNumericCharrepresenting that value, wrapped in aSome. Otherwise, the passedCharvalue is not a numeric character value, so this method will returnNone.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsCharliterals at compile time, whereasfrominspectsCharvalues at run time.- value
- the - Charto inspect, and if numeric, return wrapped in a- Some[NumericChar].
- returns
- the specified - Charvalue wrapped in a- Some[NumericChar], if it is numeric, else- None.
 
-    def fromOrElse(value: Char, default: => NumericChar): NumericCharA factory method that produces a NumericChargiven aCharvalue and a defaultNumericChar.A factory method that produces a NumericChargiven aCharvalue and a defaultNumericChar.This method will inspect the passed Charvalue and if it is a valid numeric Char (between '0' and '9'), it will return aNumericCharrepresenting that value. Otherwise, the passedCharvalue is a non-digit character, so this method will return the passeddefaultvalue.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsCharliterals at compile time, whereasfromOrElseinspectsCharvalues at run time.- value
- the - Charto inspect, and if numeric, return.
- default
- the - NumericCharto return if the passed- Charvalue is not numeric.
- returns
- the specified - Charvalue wrapped in a- NumericChar, if it is numeric, else the- default- NumericCharvalue.
 
-   final  def getClass(): Class[_ <: AnyRef]- Definition Classes
- AnyRef → Any
- Annotations
- @native()
 
-    def goodOrElse[B](value: Char)(f: (Char) => B): Or[NumericChar, B]A factory/validation method that produces a NumericChar, wrapped in aGood, given a validCharvalue, or if the givenCharis invalid, an error value of typeBproduced by passing the given invalidCharvalue to the given functionf, wrapped in aBad.A factory/validation method that produces a NumericChar, wrapped in aGood, given a validCharvalue, or if the givenCharis invalid, an error value of typeBproduced by passing the given invalidCharvalue to the given functionf, wrapped in aBad.This method will inspect the passed Charvalue and if it is a numericChar, it will return aNumericCharrepresenting that value, wrapped in aGood. Otherwise, the passedCharvalue is NOT numeric, so this method will return a result of typeBobtained by passing the invalidCharvalue to the given functionf, wrapped in aBad.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsCharliterals at compile time, whereas this method inspectsCharvalues at run time.- value
- the - Charto inspect, and if numeric, return wrapped in a- Good(NumericChar).
- returns
- the specified - Charvalue wrapped in a- Good(NumericChar), if it is numeric, else a- Bad(f(value)).
 
-    def hashCode(): Int- Definition Classes
- AnyRef → Any
- Annotations
- @native()
 
-   final  def isInstanceOf[T0]: Boolean- Definition Classes
- Any
 
-    def isValid(value: Char): BooleanA predicate method that returns true if a given Charvalue is between '0' and '9'.A predicate method that returns true if a given Charvalue is between '0' and '9'.- value
- the - Charto inspect, and if numeric, return true.
- returns
- true if the specified - Charis numeric, else false.
 
-   final  def ne(arg0: AnyRef): Boolean- Definition Classes
- AnyRef
 
-   final  def notify(): Unit- Definition Classes
- AnyRef
- Annotations
- @native()
 
-   final  def notifyAll(): Unit- Definition Classes
- AnyRef
- Annotations
- @native()
 
-    def passOrElse[E](value: Char)(f: (Char) => E): Validation[E]A validation method that produces a Passgiven a validCharvalue, or an error value of typeEproduced by passing the given invalidCharvalue to the given functionf, wrapped in aFail.A validation method that produces a Passgiven a validCharvalue, or an error value of typeEproduced by passing the given invalidCharvalue to the given functionf, wrapped in aFail.This method will inspect the passed Charvalue and if it is a numericChar(between '0' and '9'), it will return aPass. Otherwise, the passedCharvalue is non-numeric, so this method will return a result of typeEobtained by passing the invalidCharvalue to the given functionf, wrapped in aFail.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsCharliterals at compile time, whereas this method inspectsCharvalues at run time.- value
- the - Charto validate that it is numeric.
- returns
- a - Passif the specified- Charvalue is numeric, else a- Failcontaining an error value produced by passing the specified- Charto the given function- f.
 
-    def rightOrElse[L](value: Char)(f: (Char) => L): Either[L, NumericChar]A factory/validation method that produces a NumericChar, wrapped in aRight, given a validCharvalue, or if the givenCharis invalid, an error value of typeLproduced by passing the given invalidCharvalue to the given functionf, wrapped in aLeft.A factory/validation method that produces a NumericChar, wrapped in aRight, given a validCharvalue, or if the givenCharis invalid, an error value of typeLproduced by passing the given invalidCharvalue to the given functionf, wrapped in aLeft.This method will inspect the passed Charvalue and if it is a numericChar(between '0' and '9'), it will return aNumericCharrepresenting that value, wrapped in aRight. Otherwise, the passedCharvalue is NOT numeric, so this method will return a result of typeLobtained by passing the invalidCharvalue to the given functionf, wrapped in aLeft.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsCharliterals at compile time, whereas this method inspectsCharvalues at run time.- value
- the - Charto inspect, and if numeric, return wrapped in a- Right(NumericChar).
- returns
- the specified - Charvalue wrapped in a- Right(NumericChar), if it is numeric, else a- Left(f(value)).
 
-   final  def synchronized[T0](arg0: => T0): T0- Definition Classes
- AnyRef
 
-    def toString(): String- Definition Classes
- AnyRef → Any
 
-    def tryingValid(value: Char): Try[NumericChar]A factory/validation method that produces a NumericChar, wrapped in aSuccess, given a validCharvalue, or if the givenCharis invalid, anAssertionError, wrapped in aFailure.A factory/validation method that produces a NumericChar, wrapped in aSuccess, given a validCharvalue, or if the givenCharis invalid, anAssertionError, wrapped in aFailure.This method will inspect the passed Charvalue and if it represents a numeric value (between '0' and '9'), it will return aNumericCharrepresenting that value, wrapped in aSuccess. Otherwise, the passedCharvalue is not numeric, so this method will return anAssertionError, wrapped in aFailure.This factory method differs from the applyfactory method in thatapplyis implemented via a macro that inspectsCharliterals at compile time, whereas this method inspectsCharvalues at run time.- value
- the - Charto inspect, and if numeric, return wrapped in a- Success(NumericChar).
- returns
- the specified - Charvalue wrapped in a- Success(NumericChar), if it is numeric, else a- Failure(AssertionError).
 
-   final  def wait(): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
 
-   final  def wait(arg0: Long, arg1: Int): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
 
-   final  def wait(arg0: Long): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
 
-   implicit  def widenToDouble(value: NumericChar): DoubleImplicit widening conversion from NumericChartoDouble.Implicit widening conversion from NumericChartoDouble.- value
- the - NumericCharto widen
- returns
- the - Doublewiden from the specified- NumericChar.
 
-   implicit  def widenToFiniteDouble(pos: NumericChar): FiniteDoubleImplicit widening conversion from NumericChartoFiniteDouble.Implicit widening conversion from NumericChartoFiniteDouble.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Doubleand wrapped in a- FiniteDouble.
 
-   implicit  def widenToFiniteFloat(pos: NumericChar): FiniteFloatImplicit widening conversion from NumericChartoFiniteFloat.Implicit widening conversion from NumericChartoFiniteFloat.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Floatand wrapped in a- FiniteFloat.
 
-   implicit  def widenToFloat(value: NumericChar): FloatImplicit widening conversion from NumericChartoFloat.Implicit widening conversion from NumericChartoFloat.- value
- the - NumericCharto widen
- returns
- the - Floatwiden from the specified- NumericChar.
 
-   implicit  def widenToInt(value: NumericChar): IntImplicit widening conversion from NumericChartoInt.Implicit widening conversion from NumericChartoInt.- value
- the - NumericCharto widen
- returns
- the - Intwiden from the specified- NumericChar.
 
-   implicit  def widenToLong(value: NumericChar): LongImplicit widening conversion from NumericChartoLong.Implicit widening conversion from NumericChartoLong.- value
- the - NumericCharto widen
- returns
- the - Longwiden from the specified- NumericChar.
 
-   implicit  def widenToPosDouble(pos: NumericChar): PosDoubleImplicit widening conversion from NumericChartoPosDouble.Implicit widening conversion from NumericChartoPosDouble.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Doubleand wrapped in a- PosDouble.
 
-   implicit  def widenToPosFiniteDouble(pos: NumericChar): PosFiniteDoubleImplicit widening conversion from NumericChartoPosFiniteDouble.Implicit widening conversion from NumericChartoPosFiniteDouble.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Doubleand wrapped in a- PosFiniteDouble.
 
-   implicit  def widenToPosFiniteFloat(pos: NumericChar): PosFiniteFloatImplicit widening conversion from NumericChartoPosFiniteFloat.Implicit widening conversion from NumericChartoPosFiniteFloat.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Floatand wrapped in a- PosFiniteFloat.
 
-   implicit  def widenToPosFloat(pos: NumericChar): PosFloatImplicit widening conversion from NumericChartoPosFloat.Implicit widening conversion from NumericChartoPosFloat.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Floatand wrapped in a- PosFloat.
 
-   implicit  def widenToPosInt(pos: NumericChar): PosIntImplicit widening conversion from NumericChartoPosInt.Implicit widening conversion from NumericChartoPosInt.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Intand wrapped in a- PosInt.
 
-   implicit  def widenToPosLong(pos: NumericChar): PosLongImplicit widening conversion from NumericChartoPosLong.Implicit widening conversion from NumericChartoPosLong.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Longand wrapped in a- PosLong.
 
-   implicit  def widenToPosZDouble(pos: NumericChar): PosZDoubleImplicit widening conversion from NumericChartoPosZDouble.Implicit widening conversion from NumericChartoPosZDouble.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Doubleand wrapped in a- PosZDouble.
 
-   implicit  def widenToPosZFiniteDouble(pos: NumericChar): PosZFiniteDoubleImplicit widening conversion from NumericChartoPosZFiniteDouble.Implicit widening conversion from NumericChartoPosZFiniteDouble.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Doubleand wrapped in a- PosZFiniteDouble.
 
-   implicit  def widenToPosZFiniteFloat(pos: NumericChar): PosZFiniteFloatImplicit widening conversion from NumericChartoPosZFiniteFloat.Implicit widening conversion from NumericChartoPosZFiniteFloat.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Floatand wrapped in a- PosZFiniteFloat.
 
-   implicit  def widenToPosZFloat(pos: NumericChar): PosZFloatImplicit widening conversion from NumericChartoPosZFloat.Implicit widening conversion from NumericChartoPosZFloat.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Floatand wrapped in a- PosZFloat.
 
-   implicit  def widenToPosZInt(pos: NumericChar): PosZIntImplicit widening conversion from NumericChartoPosZInt.Implicit widening conversion from NumericChartoPosZInt.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Intand wrapped in a- PosZInt.
 
-   implicit  def widenToPosZLong(pos: NumericChar): PosZLongImplicit widening conversion from NumericChartoPosZLong.Implicit widening conversion from NumericChartoPosZLong.- pos
- the - NumericCharto widen
- returns
- the - Intvalue underlying the specified- NumericChar, widened to- Longand wrapped in a- PosZLong.