Function0
A function of 0 parameters.
In the following example, the definition of javaVersion is a shorthand for the anonymous class definition anonfun0:
object Main extends App {
val javaVersion = () => sys.props("java.version")
val anonfun0 = new Function0[String] {
def apply(): String = sys.props("java.version")
}
assert(javaVersion() == anonfun0())
}
- Source:
- Function0.scala
class FromJavaBooleanSupplier
class FromJavaDoubleSupplier
class FromJavaIntSupplier
class FromJavaLongSupplier
class FromJavaSupplier[T]
trait Reference[T]
trait ReferenceWrapper[T]
class PhantomReference[T]
class SoftReference[T]
class WeakReference[T]
class AbstractFunction0[R]
trait JFunction0$mcB$sp
trait JFunction0$mcC$sp
trait JFunction0$mcD$sp
trait JFunction0$mcF$sp
trait JFunction0$mcI$sp
trait JFunction0$mcJ$sp
trait JFunction0$mcS$sp
trait JFunction0$mcV$sp
trait JFunction0$mcZ$sp
() => R
Value members
Abstract methods
Apply the body of this function to the arguments.
Apply the body of this function to the arguments.
- Returns:
the result of function application.
- Source:
- Function0.scala
Concrete methods
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
- Returns:
a string representation of the object.
- Definition Classes
- Source:
- Function0.scala