summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-03-19 08:49:52 +0000
committerGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-03-19 08:49:52 +0000
commit8177b1fbfd1630f20c7704b319cc7c3536edec10 (patch)
tree70d16110f162cd52cf47575a3eaa64d415dc9fc4
parent2c36f5cad271a89cf4896ffd0bcb67805193b306 (diff)
downloadscala-8177b1fbfd1630f20c7704b319cc7c3536edec10.tar.gz
scala-8177b1fbfd1630f20c7704b319cc7c3536edec10.tar.bz2
scala-8177b1fbfd1630f20c7704b319cc7c3536edec10.zip
Added a trait for equivalence relations.
Updated the copyright in Ordered.scala, changed references to a "class" to a "trait".
-rw-r--r--src/library/scala/Equiv.scala25
-rw-r--r--src/library/scala/Ordered.scala6
2 files changed, 28 insertions, 3 deletions
diff --git a/src/library/scala/Equiv.scala b/src/library/scala/Equiv.scala
new file mode 100644
index 0000000000..32154900e4
--- /dev/null
+++ b/src/library/scala/Equiv.scala
@@ -0,0 +1,25 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2003-2008, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $Id$
+
+package scala
+
+/** A trait for representing equivalence relations.
+ * @author Geoffrey Washburn
+ * @version 0.9, 2008-03-19
+ */
+
+trait Equiv[T] {
+ /** Returns <code>true</code> iff <code>x</code> is equivalent to
+ /** <code>y</code>. The implementation
+ /* should be equivalence relation: reflexive, transitive,
+ /* symmetric.
+ */
+ def equiv(x: T, y: T): Boolean
+}
diff --git a/src/library/scala/Ordered.scala b/src/library/scala/Ordered.scala
index 1e3911918f..7f172567a3 100644
--- a/src/library/scala/Ordered.scala
+++ b/src/library/scala/Ordered.scala
@@ -1,6 +1,6 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **
+** / __/ __// _ | / / / _ | (c) 2003-2008, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
@@ -11,9 +11,9 @@
package scala
-/** A class for totally ordered data.
+/** A trait for totally ordered data.
*
- * Note that since version 2006-07-24 this class is no longer covariant in a.
+ * Note that since version 2006-07-24 this trait is no longer covariant in a.
*
* It is important that the equals method for an instance of
* Ordered[A] be consistent with the compare method. However,