_methods

trait _methods

Int Extension Methods

Extension methods universaly avaialble for type scala.Int

Source
_methods.scala
class java.lang.Object
trait scala.Matchable
class Any

Def

@targetName("range")
inline def <>(to: Int): Int.Range

Range

Range

Returns Int.Range from current to given value

 (1 <> 10).tp  // Prints  1 <> 10
Source
_methods.scala
@targetName("rangeOfSize")
inline def <>=(size: Int): Int.Range

Range by size

Range by size

Returns Int.Range starting at current value and with given size

 (5 <>= 10).tp  // Prints 5 <> 14
Source
_methods.scala
@targetName("rangeX")
inline def <>>(to: Int): Int.Range

Exclusive end range

Exclusive end range

Returns Int.Range from current to given value exclusive

 (1 <>> 10).tp  // Prints  1 <> 9
Source
_methods.scala
@targetName("Opt")
inline def ?: Int.Opt

To option

To option

Returns Int.Opt for current value

 val o : Int.Opt = 12.?
Source
_methods.scala
inline def max(v: Int): Int

Max value

Max value

Returns maximum of current or given value

 val b = 5

 b.max(0).tp   // Prints 5

 b.max(10).tp  // Prints 10
Source
_methods.scala
inline def min(v: Int): Int

Min value

Min value

Returns minimun of current or given value

 val b = 5

 b.min(0).tp   // Prints 0

 b.min(10).tp  // Prints 5
Source
_methods.scala
inline def roundTo(unit: Int)(using r: Math.Rounding): Int

Round to size

Round to size

Rounds current value to specified size

 91.roundTo(5).tp            // Prints 90

 91.roundTo(5)(using UP).tp  // Prints 95
Source
_methods.scala
inline def toByte: Byte

Make Byte

Make Byte

Attached Byte constructor

Source
_methods.scala
inline def toChar: Char

Make Char

Make Char

Attached Char constructor

Source
_methods.scala
inline def toDouble: Double

Make Double

Make Double

Attached Double constructor

Source
_methods.scala
inline def toFloat: Float

Make Float

Make Float

Attached Float constructor

Source
_methods.scala
inline def toInt: Int

Make Int

Make Int

Returns underlying value

Source
_methods.scala
inline def toLong: Long

Make Long

Make Long

Attached Long constructor

Source
_methods.scala
inline def toNumber: java.lang.Integer

Make Number

Make Number

Attached Number constructor

Source
_methods.scala
inline def toShort: Short

Make Short

Make Short

Attached Short constructor

Source
_methods.scala

Make

inline def Big: BigInteger

Make BigInteger

Make BigInteger

BigInteger constructor attached to Int

Source
_methods.scala
inline def ByteCount: ByteCount

Make ByteCount

Make ByteCount

ByteCount constructor attached to Int

Source
_methods.scala
inline def Day: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Days: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Hour: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Hours: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Micros: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Millis: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Minute: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Minutes: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Nanos: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Percent: Percent

Make Percent

Make Percent

Percent constructor attached to Int

Source
_methods.scala
inline def Second: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Seconds: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Week: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Weeks: Time.Length

Make Time.Length

Make Time.Length

Time.Length constructor attached to Int

Source
_methods.scala
inline def Year: Year

Make Year

Make Year

Year constructor attached to Int

Source
_methods.scala