object PosInt
The companion object for PosInt that offers factory methods that
produce PosInts, implicit widening conversions from PosInt
to other numeric types, and maximum and minimum constant values for PosInt.
- Source
- PosInt.scala
- Alphabetic
- By Inheritance
- PosInt
- 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: PosInt
The largest value representable as a positive
Int, which isPosInt(2147483647). - final val MinValue: PosInt
The smallest value representable as a positive
Int, which isPosInt(1). - implicit macro def apply(value: Int): PosInt
A factory method, implemented via a macro, that produces a
PosIntif passed a validIntliteral, otherwise a compile time error.A factory method, implemented via a macro, that produces a
PosIntif passed a validIntliteral, otherwise a compile time error.The macro that implements this method will inspect the specified
Intexpression at compile time. If the expression is a positiveIntliteral, i.e., with a value greater than 0, it will return aPosIntrepresenting that value. Otherwise, the passedIntexpression is either a literal that is 0 or negative, 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 inspectsIntliterals at compile time, whereasfrominspectsIntvalues at run time.- value
the
Intliteral expression to inspect at compile time, and if positive, to return wrapped in aPosIntat run time.- returns
the specified, valid
Intliteral value wrapped in aPosInt. (If the specified expression is not a validIntliteral, 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[PosInt]
A factory method that produces an
Option[PosInt]given anIntvalue.A factory method that produces an
Option[PosInt]given anIntvalue.This method will inspect the passed
Intvalue and if it is a positiveInt, i.e., a value greater than 0, it will return aPosIntrepresenting that value, wrapped in aSome. Otherwise, the passedIntvalue is 0 or negative, so this method will returnNone.This factory method differs from the
applyfactory method in thatapplyis implemented via a macro that inspectsIntliterals at compile time, whereasfrominspectsIntvalues at run time.- value
the
Intto inspect, and if positive, return wrapped in aSome[PosInt].- returns
the specified
Intvalue wrapped in aSome[PosInt], 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 posIntOrd: Ordering[PosInt]
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(pos: PosInt): Double
Implicit widening conversion from
PosInttoDouble.Implicit widening conversion from
PosInttoDouble.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toDouble.
- implicit def widenToFloat(pos: PosInt): Float
Implicit widening conversion from
PosInttoFloat.Implicit widening conversion from
PosInttoFloat.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toFloat.
- implicit def widenToInt(pos: PosInt): Int
Implicit widening conversion from
PosInttoInt.Implicit widening conversion from
PosInttoInt.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt.
- implicit def widenToLong(pos: PosInt): Long
Implicit widening conversion from
PosInttoLong.Implicit widening conversion from
PosInttoLong.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toLong.
- implicit def widenToPosDouble(pos: PosInt): PosDouble
Implicit widening conversion from
PosInttoPosDouble.Implicit widening conversion from
PosInttoPosDouble.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toDoubleand wrapped in aPosDouble.
- implicit def widenToPosFloat(pos: PosInt): PosFloat
Implicit widening conversion from
PosInttoPosFloat.Implicit widening conversion from
PosInttoPosFloat.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toFloatand wrapped in aPosFloat.
- implicit def widenToPosLong(pos: PosInt): PosLong
Implicit widening conversion from
PosInttoPosLong.Implicit widening conversion from
PosInttoPosLong.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toLongand wrapped in aPosLong.
- implicit def widenToPosZDouble(pos: PosInt): PosZDouble
Implicit widening conversion from
PosInttoPosZDouble.Implicit widening conversion from
PosInttoPosZDouble.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toDoubleand wrapped in aPosZDouble.
- implicit def widenToPosZFloat(pos: PosInt): PosZFloat
Implicit widening conversion from
PosInttoPosZFloat.Implicit widening conversion from
PosInttoPosZFloat.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toFloatand wrapped in aPosZFloat.
- implicit def widenToPosZInt(pos: PosInt): PosZInt
Implicit widening conversion from
PosInttoPosZInt.Implicit widening conversion from
PosInttoPosZInt.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, wrapped in aPosZInt.
- implicit def widenToPosZLong(pos: PosInt): PosZLong
Implicit widening conversion from
PosInttoPosZLong.Implicit widening conversion from
PosInttoPosZLong.- pos
the
PosIntto widen- returns
the
Intvalue underlying the specifiedPosInt, widened toLongand wrapped in aPosZLong.