object PosZInt
The companion object for PosZInt
that offers
factory methods that produce PosZInt
s, implicit
widening conversions from PosZInt
to other
numeric types, and maximum and minimum constant values for
PosZInt
.
- Source
- PosZInt.scala
- Alphabetic
- By Inheritance
- PosZInt
- 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: PosZInt
The largest value representable as a non-negative
Int
, which isPosZInt(2147483647)
. - final val MinValue: PosZInt
The smallest value representable as a non-negative
Int
, which isPosZInt(0)
. - implicit macro def apply(value: Int): PosZInt
A factory method, implemented via a macro, that produces a
PosZInt
if passed a validInt
literal, otherwise a compile time error.A factory method, implemented via a macro, that produces a
PosZInt
if passed a validInt
literal, otherwise a compile time error.The macro that implements this method will inspect the specified
Int
expression at compile time. If the expression is a non-negativeInt
literal, i.e., with a value greater than or equal to 0, it will return aPosZInt
representing that value. Otherwise, the passedInt
expression is either a literal that is negative, 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 inspectsInt
literals at compile time, whereasfrom
inspectsInt
values at run time.- value
the
Int
literal expression to inspect at compile time, and if non-negative, to return wrapped in aPosZInt
at run time.- returns
the specified, valid
Int
literal value wrapped in aPosZInt
. (If the specified expression is not a validInt
literal, 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()
- 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: Int): Option[PosZInt]
A factory method that produces an
Option[PosZInt]
given anInt
value.A factory method that produces an
Option[PosZInt]
given anInt
value.This method will inspect the passed
Int
value and if it is a non-negativeInt
, i.e., a value greater than or equal to 0, it will return aPosZInt
representing that value, wrapped in aSome
. Otherwise, the passedInt
value is negative, so this method will returnNone
.This factory method differs from the
apply
factory method in thatapply
is implemented via a macro that inspectsInt
literals at compile time, whereasfrom
inspectsInt
values at run time.- value
the
Int
to inspect, and if non-negative, return wrapped in aSome[PosZInt]
.- returns
the specified
Int
value wrapped in aSome[PosZInt]
, if it is positive, elseNone
.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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()
- implicit val posZIntOrd: Ordering[PosZInt]
Implicit Ordering instance.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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(poz: PosZInt): Double
Implicit widening conversion from
PosZInt
toDouble
.Implicit widening conversion from
PosZInt
toDouble
.- returns
the
Int
value underlying the specifiedPosZInt
, widened toDouble
.
- implicit def widenToFloat(poz: PosZInt): Float
Implicit widening conversion from
PosZInt
toFloat
.Implicit widening conversion from
PosZInt
toFloat
.- returns
the
Int
value underlying the specifiedPosZInt
, widened toFloat
.
- implicit def widenToInt(poz: PosZInt): Int
Implicit widening conversion from
PosZInt
toInt
.Implicit widening conversion from
PosZInt
toInt
.- returns
the
Int
value underlying the specifiedPosZInt
.
- implicit def widenToLong(poz: PosZInt): Long
Implicit widening conversion from
PosZInt
toLong
.Implicit widening conversion from
PosZInt
toLong
.- returns
the
Int
value underlying the specifiedPosZInt
, widened toLong
.
- implicit def widenToPosZDouble(poz: PosZInt): PosZDouble
Implicit widening conversion from
PosZInt
toPosZDouble
.Implicit widening conversion from
PosZInt
toPosZDouble
.- returns
the
Int
value underlying the specifiedPosZInt
, widened toDouble
and wrapped in aPosZDouble
.
- implicit def widenToPosZFloat(poz: PosZInt): PosZFloat
Implicit widening conversion from
PosZInt
toPosZFloat
.Implicit widening conversion from
PosZInt
toPosZFloat
.- returns
the
Int
value underlying the specifiedPosZInt
, widened toFloat
and wrapped in aPosZFloat
.
- implicit def widenToPosZLong(poz: PosZInt): PosZLong
Implicit widening conversion from
PosZInt
toPosZLong
.Implicit widening conversion from
PosZInt
toPosZLong
.- returns
the
Int
value underlying the specifiedPosZInt
, widened toLong
and wrapped in aPosZLong
.