org.scalactic.anyvals

PosLong

object PosLong

The companion object for PosLong that offers factory methods that produce PosLongs, implicit widening conversions from PosLong to other numeric types, and maximum and minimum constant values for PosLong.

Source
PosLong.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PosLong
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final val MaxValue: PosLong

    The largest value representable as a positive Long, which is PosLong(9223372036854775807).

    The largest value representable as a positive Long, which is PosLong(9223372036854775807).

  7. final val MinValue: PosLong

    The smallest value representable as a positive Long, which is PosLong(1L).

    The smallest value representable as a positive Long, which is PosLong(1L).

  8. implicit def apply(value: Long): PosLong

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

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

    The macro that implements this method will inspect the specified Long expression at compile time. If the expression is a positive Long literal, it will return a PosLong representing that value. Otherwise, the passed Long expression is either a literal that is not positive, 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 Long literals at compile time, whereas from inspects Long values at run time.

    value

    the Long literal expression to inspect at compile time, and if positive, to return wrapped in a PosLong at run time.

    returns

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

    Annotations
    @macroImpl( ... )
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def ensuringValid(value: Long): PosLong

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

    A factory/assertion method that produces an PosLong given a valid Long value, or throws AssertionError, if given an invalid Long 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 Long value and if it is a positive Long, it will return a PosLong representing that value. Otherwise, the passed Long value is not positive, 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 Long literals at compile time, whereas from inspects Long 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 Long is positive.

    value

    the Long to inspect, and if positive, return wrapped in a PosLong.

    returns

    the specified Long value wrapped in a PosLong, if it is positive, else throws AssertionError.

    Exceptions thrown
    AssertionError

    if the passed value is not positive

  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def from(value: Long): Option[PosLong]

    A factory method that produces an Option[PosLong] given a Long value.

    A factory method that produces an Option[PosLong] given a Long value.

    This method will inspect the passed Long value and if it is a positive Long, it will return a PosLong representing that value, wrapped in a Some. Otherwise, the passed Long value is not positive, 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 Long literals at compile time, whereas from inspects Long values at run time.

    value

    the Long to inspect, and if positive, return wrapped in a Some[PosLong].

    returns

    the specified Long value wrapped in a Some[PosLong], if it is positive, else None.

  16. def fromOrElse(value: Long, default: ⇒ PosLong): PosLong

    A factory method that produces a PosLong given a Long value and a default PosLong.

    A factory method that produces a PosLong given a Long value and a default PosLong.

    This method will inspect the passed Long value and if it is a positive Long, it will return a PosLong representing that value. Otherwise, the passed Long value is not positive, 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 Long literals at compile time, whereas from inspects Long values at run time.

    value

    the Long to inspect, and if positive, return.

    default

    the PosLong to return if the passed Long value is not positive.

    returns

    the specified Long value wrapped in a PosLong, if it is positive, else the default PosLong value.

  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def goodOrElse[B](value: Long)(f: (Long) ⇒ B): Or[PosLong, B]

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

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

    This method will inspect the passed Long value and if it is a positive Long, it will return a PosLong representing that value, wrapped in a Good. Otherwise, the passed Long value is not positive, so this method will return a result of type B obtained by passing the invalid Long 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 Long literals at compile time, whereas this method inspects Long values at run time.

    value

    the Long to inspect, and if positive, return wrapped in a Good(PosLong).

    returns

    the specified Long value wrapped in a Good(PosLong), if it is positive, else a Bad(f(value)).

  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. def isValid(value: Long): Boolean

    A predicate method that returns true if a given Long value is positive.

    A predicate method that returns true if a given Long value is positive.

    value

    the Long to inspect, and if positive, return true.

    returns

    true if the specified Long is positive, else false.

  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. implicit val ordering: Ordering[PosLong]

    Implicit Ordering instance.

  26. def passOrElse[E](value: Long)(f: (Long) ⇒ E): Validation[E]

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

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

    This method will inspect the passed Long value and if it is a positive Long, it will return a Pass. Otherwise, the passed Long value is positive, so this method will return a result of type E obtained by passing the invalid Long 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 Long literals at compile time, whereas this method inspects Long values at run time.

    value

    the Long to validate that it is positive.

    returns

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

  27. def rightOrElse[L](value: Long)(f: (Long) ⇒ L): Either[L, PosLong]

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

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

    This method will inspect the passed Int value and if it is a positive Int, it will return a PosLong representing that value, wrapped in a Right. Otherwise, the passed Int value is not positive, so this method will return a result of type L obtained by passing the invalid Int 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 Int literals at compile time, whereas this method inspects Int values at run time.

    value

    the Int to inspect, and if positive, return wrapped in a Right(PosLong).

    returns

    the specified Int value wrapped in a Right(PosLong), if it is positive, else a Left(f(value)).

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    AnyRef → Any
  30. def tryingValid(value: Long): Try[PosLong]

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

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

    This method will inspect the passed Long value and if it is a positive Long, it will return a PosLong representing that value, wrapped in a Success. Otherwise, the passed Long value is not positive, 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 Long literals at compile time, whereas this method inspects Long values at run time.

    value

    the Long to inspect, and if positive, return wrapped in a Success(PosLong).

    returns

    the specified Long value wrapped in a Success(PosLong), if it is positive, else a Failure(AssertionError).

  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. implicit def widenToDouble(pos: PosLong): Double

    Implicit widening conversion from PosLong to Double.

    Implicit widening conversion from PosLong to Double.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Double.

  35. implicit def widenToFloat(pos: PosLong): Float

    Implicit widening conversion from PosLong to Float.

    Implicit widening conversion from PosLong to Float.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Float.

  36. implicit def widenToLong(pos: PosLong): Long

    Implicit widening conversion from PosLong to Long.

    Implicit widening conversion from PosLong to Long.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong.

  37. implicit def widenToNonZeroDouble(pos: PosLong): NonZeroDouble

    Implicit widening conversion from PosLong to NonZeroDouble.

    Implicit widening conversion from PosLong to NonZeroDouble.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Double and wrapped in a NonZeroDouble.

  38. implicit def widenToNonZeroFloat(pos: PosLong): NonZeroFloat

    Implicit widening conversion from PosLong to NonZeroFloat.

    Implicit widening conversion from PosLong to NonZeroFloat.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Float and wrapped in a NonZeroFloat.

  39. implicit def widenToNonZeroLong(pos: PosLong): NonZeroLong

    Implicit widening conversion from PosLong to NonZeroLong.

    Implicit widening conversion from PosLong to NonZeroLong.

    pos

    the PosLong to widen

    returns

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

  40. implicit def widenToPosDouble(pos: PosLong): PosDouble

    Implicit widening conversion from PosLong to PosDouble.

    Implicit widening conversion from PosLong to PosDouble.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Double and wrapped in a PosDouble.

  41. implicit def widenToPosFloat(pos: PosLong): PosFloat

    Implicit widening conversion from PosLong to PosFloat.

    Implicit widening conversion from PosLong to PosFloat.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Float and wrapped in a PosFloat.

  42. implicit def widenToPosZDouble(pos: PosLong): PosZDouble

    Implicit widening conversion from PosLong to PosZDouble.

    Implicit widening conversion from PosLong to PosZDouble.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Double and wrapped in a PosZDouble.

  43. implicit def widenToPosZFloat(pos: PosLong): PosZFloat

    Implicit widening conversion from PosLong to PosZFloat.

    Implicit widening conversion from PosLong to PosZFloat.

    pos

    the PosLong to widen

    returns

    the Long value underlying the specified PosLong, widened to Float and wrapped in a PosZFloat.

  44. implicit def widenToPosZLong(pos: PosLong): PosZLong

    Implicit widening conversion from PosLong to PosZLong.

    Implicit widening conversion from PosLong to PosZLong.

    pos

    the PosLong to widen

    returns

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

Deprecated Value Members

  1. val posLongOrd: Ordering[PosLong]

    The formerly implicit posLongOrd field has been deprecated and will be removed in a future version of ScalaTest. Please use the ordering field instead.

    The formerly implicit posLongOrd field has been deprecated and will be removed in a future version of ScalaTest. Please use the ordering field instead.

    Annotations
    @deprecated
    Deprecated

    The formerly implicit posLongOrd field has been deprecated and will be removed in a future version of ScalaTest. Please use the ordering field instead.

Inherited from AnyRef

Inherited from Any

Ungrouped