Class AnyRef is the root class of all reference types. All types except the value types descend from this class.
| Known subtypes | 350 types |
|---|
Tests whether the argument (that) is a reference to the receiver object (this).
The eq method implements an equivalence relation on non-null instances of AnyRef, and has three additional properties:
It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of x.eq(y) consistently returns true or consistently returns false.
For any non-null instance x of type AnyRef, x.eq(null) and null.eq(x) returns false.
null.eq(null) returns true.
When overriding the equals or hashCode 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).
| Value parameters |
|
|---|---|
| Returns |
|
Equivalent to !(this eq that).
| Value parameters |
|
|---|---|
| Returns |
|
Wakes up a single thread that is waiting on the receiver object's monitor.
| Note | not specified by SLS as a member of AnyRef |
|---|
Wakes up all threads that are waiting on the receiver object's monitor.
| Note | not specified by SLS as a member of AnyRef |
|---|
Executes the code in body with an exclusive lock on this.
| Value parameters |
|
|---|---|
| Returns | the result of |
See https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--.
| Note | not specified by SLS as a member of AnyRef |
|---|
See https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-.
| Value parameters |
|
|---|---|
| Note | not specified by SLS as a member of AnyRef |
See https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-
| Value parameters |
|
|---|---|
| Note | not specified by SLS as a member of AnyRef |
© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.2.0/scala/AnyRef.html