object FunctionWrappers
- Source
- FunctionWrappers.scala
- Alphabetic
- By Inheritance
- FunctionWrappers
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class AsJavaBiConsumer[T, U](sf: (T, U) => Unit) extends BiConsumer[T, U] with Product with Serializable
- case class AsJavaBiFunction[T, U, R](sf: (T, U) => R) extends BiFunction[T, U, R] with Product with Serializable
- case class AsJavaBiPredicate[T, U](sf: (T, U) => Boolean) extends BiPredicate[T, U] with Product with Serializable
- case class AsJavaBinaryOperator[T](sf: (T, T) => T) extends BinaryOperator[T] with Product with Serializable
- case class AsJavaBooleanSupplier(sf: () => Boolean) extends BooleanSupplier with Product with Serializable
- case class AsJavaConsumer[T](sf: (T) => Unit) extends Consumer[T] with Product with Serializable
- case class AsJavaDoubleBinaryOperator(sf: (Double, Double) => Double) extends DoubleBinaryOperator with Product with Serializable
- case class AsJavaDoubleConsumer(sf: (Double) => Unit) extends DoubleConsumer with Product with Serializable
- case class AsJavaDoubleFunction[R](sf: (Double) => R) extends DoubleFunction[R] with Product with Serializable
- case class AsJavaDoublePredicate(sf: (Double) => Boolean) extends DoublePredicate with Product with Serializable
- case class AsJavaDoubleSupplier(sf: () => Double) extends DoubleSupplier with Product with Serializable
- case class AsJavaDoubleToIntFunction(sf: (Double) => Int) extends DoubleToIntFunction with Product with Serializable
- case class AsJavaDoubleToLongFunction(sf: (Double) => Long) extends DoubleToLongFunction with Product with Serializable
- case class AsJavaDoubleUnaryOperator(sf: (Double) => Double) extends DoubleUnaryOperator with Product with Serializable
- case class AsJavaFunction[T, R](sf: (T) => R) extends java.util.function.Function[T, R] with Product with Serializable
- case class AsJavaIntBinaryOperator(sf: (Int, Int) => Int) extends IntBinaryOperator with Product with Serializable
- case class AsJavaIntConsumer(sf: (Int) => Unit) extends IntConsumer with Product with Serializable
- case class AsJavaIntFunction[R](sf: (Int) => R) extends IntFunction[R] with Product with Serializable
- case class AsJavaIntPredicate(sf: (Int) => Boolean) extends IntPredicate with Product with Serializable
- case class AsJavaIntSupplier(sf: () => Int) extends IntSupplier with Product with Serializable
- case class AsJavaIntToDoubleFunction(sf: (Int) => Double) extends IntToDoubleFunction with Product with Serializable
- case class AsJavaIntToLongFunction(sf: (Int) => Long) extends IntToLongFunction with Product with Serializable
- case class AsJavaIntUnaryOperator(sf: (Int) => Int) extends IntUnaryOperator with Product with Serializable
- case class AsJavaLongBinaryOperator(sf: (Long, Long) => Long) extends LongBinaryOperator with Product with Serializable
- case class AsJavaLongConsumer(sf: (Long) => Unit) extends LongConsumer with Product with Serializable
- case class AsJavaLongFunction[R](sf: (Long) => R) extends LongFunction[R] with Product with Serializable
- case class AsJavaLongPredicate(sf: (Long) => Boolean) extends LongPredicate with Product with Serializable
- case class AsJavaLongSupplier(sf: () => Long) extends LongSupplier with Product with Serializable
- case class AsJavaLongToDoubleFunction(sf: (Long) => Double) extends LongToDoubleFunction with Product with Serializable
- case class AsJavaLongToIntFunction(sf: (Long) => Int) extends LongToIntFunction with Product with Serializable
- case class AsJavaLongUnaryOperator(sf: (Long) => Long) extends LongUnaryOperator with Product with Serializable
- case class AsJavaObjDoubleConsumer[T](sf: (T, Double) => Unit) extends ObjDoubleConsumer[T] with Product with Serializable
- case class AsJavaObjIntConsumer[T](sf: (T, Int) => Unit) extends ObjIntConsumer[T] with Product with Serializable
- case class AsJavaObjLongConsumer[T](sf: (T, Long) => Unit) extends ObjLongConsumer[T] with Product with Serializable
- case class AsJavaPredicate[T](sf: (T) => Boolean) extends Predicate[T] with Product with Serializable
- case class AsJavaSupplier[T](sf: () => T) extends Supplier[T] with Product with Serializable
- case class AsJavaToDoubleBiFunction[T, U](sf: (T, U) => Double) extends ToDoubleBiFunction[T, U] with Product with Serializable
- case class AsJavaToDoubleFunction[T](sf: (T) => Double) extends ToDoubleFunction[T] with Product with Serializable
- case class AsJavaToIntBiFunction[T, U](sf: (T, U) => Int) extends ToIntBiFunction[T, U] with Product with Serializable
- case class AsJavaToIntFunction[T](sf: (T) => Int) extends ToIntFunction[T] with Product with Serializable
- case class AsJavaToLongBiFunction[T, U](sf: (T, U) => Long) extends ToLongBiFunction[T, U] with Product with Serializable
- case class AsJavaToLongFunction[T](sf: (T) => Long) extends ToLongFunction[T] with Product with Serializable
- case class AsJavaUnaryOperator[T](sf: (T) => T) extends UnaryOperator[T] with Product with Serializable
- case class FromJavaBiConsumer[T, U](jf: BiConsumer[T, U]) extends (T, U) => Unit with Product with Serializable
- case class FromJavaBiFunction[T, U, R](jf: BiFunction[T, U, R]) extends (T, U) => R with Product with Serializable
- case class FromJavaBiPredicate[T, U](jf: BiPredicate[T, U]) extends (T, U) => Boolean with Product with Serializable
- case class FromJavaBinaryOperator[T](jf: BinaryOperator[T]) extends (T, T) => T with Product with Serializable
- case class FromJavaBooleanSupplier(jf: BooleanSupplier) extends () => Boolean with Product with Serializable
- case class FromJavaConsumer[T](jf: Consumer[T]) extends (T) => Unit with Product with Serializable
- case class FromJavaDoubleBinaryOperator(jf: DoubleBinaryOperator) extends (Double, Double) => Double with Product with Serializable
- case class FromJavaDoubleConsumer(jf: DoubleConsumer) extends (Double) => Unit with Product with Serializable
- case class FromJavaDoubleFunction[R](jf: DoubleFunction[R]) extends (Double) => R with Product with Serializable
- case class FromJavaDoublePredicate(jf: DoublePredicate) extends (Double) => Boolean with Product with Serializable
- case class FromJavaDoubleSupplier(jf: DoubleSupplier) extends () => Double with Product with Serializable
- case class FromJavaDoubleToIntFunction(jf: DoubleToIntFunction) extends (Double) => Int with Product with Serializable
- case class FromJavaDoubleToLongFunction(jf: DoubleToLongFunction) extends (Double) => Long with Product with Serializable
- case class FromJavaDoubleUnaryOperator(jf: DoubleUnaryOperator) extends (Double) => Double with Product with Serializable
- case class FromJavaFunction[T, R](jf: java.util.function.Function[T, R]) extends (T) => R with Product with Serializable
- case class FromJavaIntBinaryOperator(jf: IntBinaryOperator) extends (Int, Int) => Int with Product with Serializable
- case class FromJavaIntConsumer(jf: IntConsumer) extends (Int) => Unit with Product with Serializable
- case class FromJavaIntFunction[R](jf: IntFunction[R]) extends (Int) => R with Product with Serializable
- case class FromJavaIntPredicate(jf: IntPredicate) extends (Int) => Boolean with Product with Serializable
- case class FromJavaIntSupplier(jf: IntSupplier) extends () => Int with Product with Serializable
- case class FromJavaIntToDoubleFunction(jf: IntToDoubleFunction) extends (Int) => Double with Product with Serializable
- case class FromJavaIntToLongFunction(jf: IntToLongFunction) extends (Int) => Long with Product with Serializable
- case class FromJavaIntUnaryOperator(jf: IntUnaryOperator) extends (Int) => Int with Product with Serializable
- case class FromJavaLongBinaryOperator(jf: LongBinaryOperator) extends (Long, Long) => Long with Product with Serializable
- case class FromJavaLongConsumer(jf: LongConsumer) extends (Long) => Unit with Product with Serializable
- case class FromJavaLongFunction[R](jf: LongFunction[R]) extends (Long) => R with Product with Serializable
- case class FromJavaLongPredicate(jf: LongPredicate) extends (Long) => Boolean with Product with Serializable
- case class FromJavaLongSupplier(jf: LongSupplier) extends () => Long with Product with Serializable
- case class FromJavaLongToDoubleFunction(jf: LongToDoubleFunction) extends (Long) => Double with Product with Serializable
- case class FromJavaLongToIntFunction(jf: LongToIntFunction) extends (Long) => Int with Product with Serializable
- case class FromJavaLongUnaryOperator(jf: LongUnaryOperator) extends (Long) => Long with Product with Serializable
- case class FromJavaObjDoubleConsumer[T](jf: ObjDoubleConsumer[T]) extends (T, Double) => Unit with Product with Serializable
- case class FromJavaObjIntConsumer[T](jf: ObjIntConsumer[T]) extends (T, Int) => Unit with Product with Serializable
- case class FromJavaObjLongConsumer[T](jf: ObjLongConsumer[T]) extends (T, Long) => Unit with Product with Serializable
- case class FromJavaPredicate[T](jf: Predicate[T]) extends (T) => Boolean with Product with Serializable
- case class FromJavaSupplier[T](jf: Supplier[T]) extends () => T with Product with Serializable
- case class FromJavaToDoubleBiFunction[T, U](jf: ToDoubleBiFunction[T, U]) extends (T, U) => Double with Product with Serializable
- case class FromJavaToDoubleFunction[T](jf: ToDoubleFunction[T]) extends (T) => Double with Product with Serializable
- case class FromJavaToIntBiFunction[T, U](jf: ToIntBiFunction[T, U]) extends (T, U) => Int with Product with Serializable
- case class FromJavaToIntFunction[T](jf: ToIntFunction[T]) extends (T) => Int with Product with Serializable
- case class FromJavaToLongBiFunction[T, U](jf: ToLongBiFunction[T, U]) extends (T, U) => Long with Product with Serializable
- case class FromJavaToLongFunction[T](jf: ToLongFunction[T]) extends (T) => Long with Product with Serializable
- case class FromJavaUnaryOperator[T](jf: UnaryOperator[T]) extends (T) => T with Product with Serializable
- final class RichBiConsumerAsFunction2[T, U] extends AnyVal
- final class RichBiFunctionAsFunction2[T, U, R] extends AnyVal
- final class RichBiPredicateAsFunction2[T, U] extends AnyVal
- final class RichBinaryOperatorAsFunction2[T] extends AnyVal
- final class RichBooleanSupplierAsFunction0 extends AnyVal
- final class RichConsumerAsFunction1[T] extends AnyVal
- final class RichDoubleBinaryOperatorAsFunction2 extends AnyVal
- final class RichDoubleConsumerAsFunction1 extends AnyVal
- final class RichDoubleFunctionAsFunction1[R] extends AnyVal
- final class RichDoublePredicateAsFunction1 extends AnyVal
- final class RichDoubleSupplierAsFunction0 extends AnyVal
- final class RichDoubleToIntFunctionAsFunction1 extends AnyVal
- final class RichDoubleToLongFunctionAsFunction1 extends AnyVal
- final class RichDoubleUnaryOperatorAsFunction1 extends AnyVal
- final class RichFunction0AsBooleanSupplier extends AnyVal
- final class RichFunction0AsDoubleSupplier extends AnyVal
- final class RichFunction0AsIntSupplier extends AnyVal
- final class RichFunction0AsLongSupplier extends AnyVal
- final class RichFunction0AsSupplier[T] extends AnyVal
- final class RichFunction1AsConsumer[T] extends AnyVal
- final class RichFunction1AsDoubleConsumer extends AnyVal
- final class RichFunction1AsDoubleFunction[R] extends AnyVal
- final class RichFunction1AsDoublePredicate extends AnyVal
- final class RichFunction1AsDoubleToIntFunction extends AnyVal
- final class RichFunction1AsDoubleToLongFunction extends AnyVal
- final class RichFunction1AsDoubleUnaryOperator extends AnyVal
- final class RichFunction1AsFunction[T, R] extends AnyVal
- final class RichFunction1AsIntConsumer extends AnyVal
- final class RichFunction1AsIntFunction[R] extends AnyVal
- final class RichFunction1AsIntPredicate extends AnyVal
- final class RichFunction1AsIntToDoubleFunction extends AnyVal
- final class RichFunction1AsIntToLongFunction extends AnyVal
- final class RichFunction1AsIntUnaryOperator extends AnyVal
- final class RichFunction1AsLongConsumer extends AnyVal
- final class RichFunction1AsLongFunction[R] extends AnyVal
- final class RichFunction1AsLongPredicate extends AnyVal
- final class RichFunction1AsLongToDoubleFunction extends AnyVal
- final class RichFunction1AsLongToIntFunction extends AnyVal
- final class RichFunction1AsLongUnaryOperator extends AnyVal
- final class RichFunction1AsPredicate[T] extends AnyVal
- final class RichFunction1AsToDoubleFunction[T] extends AnyVal
- final class RichFunction1AsToIntFunction[T] extends AnyVal
- final class RichFunction1AsToLongFunction[T] extends AnyVal
- final class RichFunction1AsUnaryOperator[T] extends AnyVal
- final class RichFunction2AsBiConsumer[T, U] extends AnyVal
- final class RichFunction2AsBiFunction[T, U, R] extends AnyVal
- final class RichFunction2AsBiPredicate[T, U] extends AnyVal
- final class RichFunction2AsBinaryOperator[T] extends AnyVal
- final class RichFunction2AsDoubleBinaryOperator extends AnyVal
- final class RichFunction2AsIntBinaryOperator extends AnyVal
- final class RichFunction2AsLongBinaryOperator extends AnyVal
- final class RichFunction2AsObjDoubleConsumer[T] extends AnyVal
- final class RichFunction2AsObjIntConsumer[T] extends AnyVal
- final class RichFunction2AsObjLongConsumer[T] extends AnyVal
- final class RichFunction2AsToDoubleBiFunction[T, U] extends AnyVal
- final class RichFunction2AsToIntBiFunction[T, U] extends AnyVal
- final class RichFunction2AsToLongBiFunction[T, U] extends AnyVal
- final class RichFunctionAsFunction1[T, R] extends AnyVal
- final class RichIntBinaryOperatorAsFunction2 extends AnyVal
- final class RichIntConsumerAsFunction1 extends AnyVal
- final class RichIntFunctionAsFunction1[R] extends AnyVal
- final class RichIntPredicateAsFunction1 extends AnyVal
- final class RichIntSupplierAsFunction0 extends AnyVal
- final class RichIntToDoubleFunctionAsFunction1 extends AnyVal
- final class RichIntToLongFunctionAsFunction1 extends AnyVal
- final class RichIntUnaryOperatorAsFunction1 extends AnyVal
- final class RichLongBinaryOperatorAsFunction2 extends AnyVal
- final class RichLongConsumerAsFunction1 extends AnyVal
- final class RichLongFunctionAsFunction1[R] extends AnyVal
- final class RichLongPredicateAsFunction1 extends AnyVal
- final class RichLongSupplierAsFunction0 extends AnyVal
- final class RichLongToDoubleFunctionAsFunction1 extends AnyVal
- final class RichLongToIntFunctionAsFunction1 extends AnyVal
- final class RichLongUnaryOperatorAsFunction1 extends AnyVal
- final class RichObjDoubleConsumerAsFunction2[T] extends AnyVal
- final class RichObjIntConsumerAsFunction2[T] extends AnyVal
- final class RichObjLongConsumerAsFunction2[T] extends AnyVal
- final class RichPredicateAsFunction1[T] extends AnyVal
- final class RichSupplierAsFunction0[T] extends AnyVal
- final class RichToDoubleBiFunctionAsFunction2[T, U] extends AnyVal
- final class RichToDoubleFunctionAsFunction1[T] extends AnyVal
- final class RichToIntBiFunctionAsFunction2[T, U] extends AnyVal
- final class RichToIntFunctionAsFunction1[T] extends AnyVal
- final class RichToLongBiFunctionAsFunction2[T, U] extends AnyVal
- final class RichToLongFunctionAsFunction1[T] extends AnyVal
- final class RichUnaryOperatorAsFunction1[T] extends AnyVal
Value Members
- final def !=(arg0: Any): Boolean
Test two objects for inequality.
Test two objects for inequality.
- returns
true
if !(this == that), false otherwise.
- Definition Classes
- AnyRef → Any
- final def ##: Int
Equivalent to
x.hashCode
except for boxed numeric types andnull
.Equivalent to
x.hashCode
except for boxed numeric types andnull
. For numerics, it returns a hash value which is consistent with value equality: if two value type instances compare as true, then ## will produce the same hash value for each of them. Fornull
returns a hashcode wherenull.hashCode
throws aNullPointerException
.- returns
a hash value consistent with ==
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
The expression
x == that
is equivalent toif (x eq null) that eq null else x.equals(that)
.The expression
x == that
is equivalent toif (x eq null) that eq null else x.equals(that)
.- returns
true
if the receiver object is equivalent to the argument;false
otherwise.
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
Cast the receiver object to be of type
T0
.Cast the receiver object to be of type
T0
.Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression
1.asInstanceOf[String]
will throw aClassCastException
at runtime, while the expressionList(1).asInstanceOf[List[String]]
will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested type.- returns
the receiver object.
- Definition Classes
- Any
- Exceptions thrown
ClassCastException
if the receiver object is not an instance of the erasure of typeT0
.
- def clone(): AnyRef
Create a copy of the receiver object.
Create a copy of the receiver object.
The default implementation of the
clone
method is platform dependent.- returns
a copy of the receiver object.
- final def eq(arg0: AnyRef): Boolean
Tests whether the argument (
that
) is a reference to the receiver object (this
).Tests whether the argument (
that
) is a reference to the receiver object (this
).The
eq
method implements an equivalence relation on non-null instances ofAnyRef
, and has three additional properties:- It is consistent: for any non-null instances
x
andy
of typeAnyRef
, multiple invocations ofx.eq(y)
consistently returnstrue
or consistently returnsfalse
. - For any non-null instance
x
of typeAnyRef
,x.eq(null)
andnull.eq(x)
returnsfalse
. null.eq(null)
returnstrue
.
When overriding the
equals
orhashCode
methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2
), they should be equal to each other (o1 == o2
) and they should hash to the same value (o1.hashCode == o2.hashCode
).- returns
true
if the argument is a reference to the receiver object;false
otherwise.
- Definition Classes
- AnyRef
- It is consistent: for any non-null instances
- def equals(arg0: AnyRef): Boolean
The equality method for reference types.
- def finalize(): Unit
Called by the garbage collector on the receiver object when there are no more references to the object.
Called by the garbage collector on the receiver object when there are no more references to the object.
The details of when and if the
finalize
method is invoked, as well as the interaction betweenfinalize
and non-local returns and exceptions, are all platform dependent.- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- Note
not specified by SLS as a member of AnyRef
- final def getClass(): Class[_ <: AnyRef]
Returns the runtime class representation of the object.
- def hashCode(): Int
The hashCode method for reference types.
- final def isInstanceOf[T0]: Boolean
Test whether the dynamic type of the receiver object is
T0
.Test whether the dynamic type of the receiver object is
T0
.Note that the result of the test is modulo Scala's erasure semantics. Therefore the expression
1.isInstanceOf[String]
will returnfalse
, while the expressionList(1).isInstanceOf[List[String]]
will returntrue
. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the specified type.- returns
true
if the receiver object is an instance of erasure of typeT0
;false
otherwise.
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
Equivalent to
!(this eq that)
.Equivalent to
!(this eq that)
.- returns
true
if the argument is not a reference to the receiver object;false
otherwise.
- Definition Classes
- AnyRef
- final def notify(): Unit
Wakes up a single thread that is waiting on the receiver object's monitor.
Wakes up a single thread that is waiting on the receiver object's monitor.
- Definition Classes
- AnyRef
- Annotations
- @native()
- Note
not specified by SLS as a member of AnyRef
- final def notifyAll(): Unit
Wakes up all threads that are waiting on the receiver object's monitor.
Wakes up all threads that are waiting on the receiver object's monitor.
- Definition Classes
- AnyRef
- Annotations
- @native()
- Note
not specified by SLS as a member of AnyRef
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
Creates a String representation of this object.
Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.
- returns
a String representation of the object.
- 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
This is the documentation for the Scala standard library.
Package structure
The scala package contains core types like
Int
,Float
,Array
orOption
which are accessible in all Scala compilation units without explicit qualification or imports.Notable packages include:
scala.collection
and its sub-packages contain Scala's collections frameworkscala.collection.immutable
- Immutable, sequential data-structures such asVector
,List
,Range
,HashMap
orHashSet
scala.collection.mutable
- Mutable, sequential data-structures such asArrayBuffer
,StringBuilder
,HashMap
orHashSet
scala.collection.concurrent
- Mutable, concurrent data-structures such asTrieMap
scala.concurrent
- Primitives for concurrent programming such asFutures
andPromises
scala.io
- Input and output operationsscala.math
- Basic math functions and additional numeric types likeBigInt
andBigDecimal
scala.sys
- Interaction with other processes and the operating systemscala.util.matching
- Regular expressionsOther packages exist. See the complete list on the right.
Additional parts of the standard library are shipped as separate libraries. These include:
scala.reflect
- Scala's reflection API (scala-reflect.jar)scala.xml
- XML parsing, manipulation, and serialization (scala-xml.jar)scala.collection.parallel
- Parallel collections (scala-parallel-collections.jar)scala.util.parsing
- Parser combinators (scala-parser-combinators.jar)scala.swing
- A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar)Automatic imports
Identifiers in the scala package and the
scala.Predef
object are always in scope by default.Some of these identifiers are type aliases provided as shortcuts to commonly used classes. For example,
List
is an alias forscala.collection.immutable.List
.Other aliases refer to classes provided by the underlying platform. For example, on the JVM,
String
is an alias forjava.lang.String
.