summaryrefslogtreecommitdiff
path: root/src/library/scala/Equals.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/Equals.scala')
-rw-r--r--src/library/scala/Equals.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/library/scala/Equals.scala b/src/library/scala/Equals.scala
new file mode 100644
index 0000000000..aa02cb0982
--- /dev/null
+++ b/src/library/scala/Equals.scala
@@ -0,0 +1,26 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2009, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $Id: Equals.scala 18478 2009-08-13 21:30:20Z stepancheg $
+
+package scala
+
+/** An interface containing operations for equality
+ * The only method not already present in AnyRef is canEqual
+ */
+trait Equals {
+ /** A method that should be called from every well-designed equals method
+ * that is open to be overridden in a subclass. See Programming in Scala, Chapter 28
+ * for discussion and design.
+ */
+ def canEqual(that: Any): Boolean
+
+ /** The equality method defined in AnyRef
+ */
+ def equals(that: Any): Boolean
+}