diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2007-03-28 10:44:12 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2007-03-28 10:44:12 +0000 |
commit | 806238432588319e91805570ffbfc2f0ce5f409b (patch) | |
tree | 2722f8826abe3bd63fd8053854e674620e78f131 /src/library/scala/collection/Set.scala | |
parent | a4d94d427ae80d191060338b230c4d88948059cb (diff) | |
download | scala-806238432588319e91805570ffbfc2f0ce5f409b.tar.gz scala-806238432588319e91805570ffbfc2f0ce5f409b.tar.bz2 scala-806238432588319e91805570ffbfc2f0ce5f409b.zip |
Revamped scala-doc.
Diffstat (limited to 'src/library/scala/collection/Set.scala')
-rw-r--r-- | src/library/scala/collection/Set.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/library/scala/collection/Set.scala b/src/library/scala/collection/Set.scala index fcea89893e..6f90a27cb4 100644 --- a/src/library/scala/collection/Set.scala +++ b/src/library/scala/collection/Set.scala @@ -61,7 +61,7 @@ trait Set[A] extends (A => Boolean) with Iterable[A] { * * @return <code>true</code> iff there is no element in the set. */ - def isEmpty: Boolean = size == 0 + override def isEmpty: Boolean = size == 0 /** Checks if this set is a subset of set <code>that</code>. * @@ -89,7 +89,7 @@ trait Set[A] extends (A => Boolean) with Iterable[A] { /** hashcode for this set */ override def hashCode() = - (0 /: this)((hash, e) => hash * 41 + e.hashCode()) + (0 /: this)((hash, e) => hash + e.hashCode()) /** Returns a string representation of this set. @@ -97,4 +97,9 @@ trait Set[A] extends (A => Boolean) with Iterable[A] { * @return a string showing all elements of this set. */ override def toString() = mkString("Set(", ", ", ")") + override def toArray[B >: A]: Array[B] = { + val result = new Array[B](size) + copyToArray(result, 0) + result + } } |