J

object J
class java.lang.Object
trait scala.Matchable
class Any

Member

opaque type File

J.File is an opaque value, backed by java.io.File

J.File does not have direct constructors. To create File one needs to start with J.File.Path

Source
__.scala
object Io

Input / Output

Note J.Input and J.Output can be called without .Io. prefix

Source
__.scala
object Json

JavaScript Object Notation Framework

Note J.Object and J.Array can be called without .Json. prefix

Source
__.scala
opaque type Url

J.Url is an opaque value, backed by java.net.URL

Source
__.scala
object Util

Alias

Alias

Alias

Shortcut to J.Util.Benchmark

Source
__.scala
type Input = J.Input

Type alias

Type alias

Shortcut to J.Io.Input

Source
__.scala
inline def Input: J.Input

Companion alias

Companion alias

Shortcut to J.Io.Input

Source
__.scala
inline def Memory: J.Memory

Companion alias

Companion alias

Shortcut to J.Vm.Memory

Source
__.scala

Type alias

Type alias

Shortcut to J.Json.Object

Source
__.scala
inline def Object: J.Object

Companion alias

Companion alias

Shortcut to J.Json.Object

Source
__.scala

Type alias

Type alias

Shortcut to J.Io.Output

Source
__.scala
inline def Output: J.Output

Companion alias

Companion alias

Shortcut to J.Io.Output

Source
__.scala
type Path = J.Path

Type alias

Type alias

Shortcut to J.File.Path

Source
__.scala
inline def Path: J.Path

Companion alias

Companion alias

Shortcut to J.File.Path

Source
__.scala
type Printer = java.io.PrintStream

Type alias

Type alias

Shortcut to java.io.PrintStream

Source
__.scala

Type alias

Type alias

Shortcut to J.Vm.Priority

Source
__.scala
inline def Priority: J.Priority

Companion alias

Companion alias

Shortcut to J.Vm.Priority

Source
__.scala
inline def Random: J.Random

Companion alias

Companion alias

Shortcut to J.Util.Random

Source
__.scala
inline def Setup: J.Setup

Companion alias

Companion alias

Shortcut to J.Vm.Setup

Source
__.scala

Type alias

Type alias

Shortcut to J.Util.Test

Source
__.scala
type WeakRef[A] = J.WeakRef[A]

Type alias

Type alias

Shortcut to J.Util.WeakRef

Source
__.scala
inline def WeakRef: J.WeakRef

Companion alias

Companion alias

Shortcut to J.Util.WeakRef

Source
__.scala

Def

inline def illegalArgument(message: String): scala.Nothing

Fail with illegal argument

Fail with illegal argument

Inlines throw new IllegalArgumentException()

The only benefit is reducing boilerplate code

Source
__.scala
inline def illegalState(message: String): scala.Nothing

Fail with illegal state

Fail with illegal state

Inlines throw new IllegalStateException()

The only benefit is reducing boilerplate code

Source
__.scala
inline def initSize: Int
Source
__.scala
def printStack(sizeLimit: Int.Opt, label: Opt[String]): Unit
Source
__.scala
def schedule[U](f: => U): Unit
Source
__.scala
def scheduleEvery[U](period: Time.Length, f: => U): Event.Control

Schedule job

Schedule job

Schedules a job to run every given period

  // Prints time every 1 second for the rest of the day

  val day = Day()

  App.Concurrent.runEvery(1.Seconds, Time.current.tp).cancelIf(day != Day())
Source
__.scala
def scheduleEveryIn[U](period: Time.Length, initDelay: Time.Length, f: => U): Event.Control

Schedule start of job

Schedule start of job

Schedules a job with given initDelay, which will run every given period

  // In 10 minutes, this will start printing time every 1 second for one hour
  Schedule.everyIn(1.Second, 10.Minutes, Time.current.tp).expireIn(1.Hour)
Source
__.scala
def scheduleIn[U](delay: Time.Length, job: => U): Event.Control

Schedule one time job

Schedule one time job

Schedules a one time job with given delay

  // Prints "Hello" in 3 seconds
   J.scheduleIn(3.Seconds, "Hello".tp)
Source
__.scala
def sleep(tl: Time.Length): Unit

Pauses current execution thread

Pauses current execution thread

J.sleep(10.Millis) // Pauses for 10 milliseconds

J.sleep(2.Seconds) // Pauses for 2 seconds

J.sleep(1.Minute)  // Pauses for 1 minute
Source
__.scala
inline def toDo(message: String): scala.Nothing

To Do tag

To Do tag

Inlines throw new UnsupportedOperationException()

'J.toDo' is the tag to leave in code to search for later.

Never use ???, which is for debugging and short term playing around

Source
__.scala
inline def unsupportedOperation(message: String): scala.Nothing

Fail unsupported

Fail unsupported

Inlines throw new UnsupportedOperationException()

The only benefit is reducing boilerplate code

Source
__.scala

Containers

type Array = J.Array

Type alias

Type alias

Shortcut to J.Json.Array

Source
__.scala
inline def Array: J.Array

Companion alias

Companion alias

Shortcut to J.Json.Array

Source
__.scala