diff options
-rw-r--r-- | src/library/scala/Enumeration.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala index 81d956c647..9c91996d23 100644 --- a/src/library/scala/Enumeration.scala +++ b/src/library/scala/Enumeration.scala @@ -162,6 +162,10 @@ abstract class Enumeration(initial: Int, names: String*) { /** the id and bit location of this enumeration value */ def id: Int override def compare(that: Value): Int = this.id - that.id + override def equals(other : Any) : Boolean = + other match { case that : Value => compare(that) == 0 + case _ => false } + override def hashCode : Int = id.hashCode /** this enumeration value as an <code>Int</code> bit mask. * @throws IllegalArgumentException if <code>id</code> is greater than 31 */ |