diff options
author | Matthias Zenger <mzenger@gmail.com> | 2003-09-24 13:01:10 +0000 |
---|---|---|
committer | Matthias Zenger <mzenger@gmail.com> | 2003-09-24 13:01:10 +0000 |
commit | 810aefd0aa810ba98bbb49fa0e1142b04f856369 (patch) | |
tree | a99ed311c9ebd3baba87ae98345f1e957546c0e5 | |
parent | 51a5386fa3225c117633ea7171760590d01bf6f3 (diff) | |
download | scala-810aefd0aa810ba98bbb49fa0e1142b04f856369.tar.gz scala-810aefd0aa810ba98bbb49fa0e1142b04f856369.tar.bz2 scala-810aefd0aa810ba98bbb49fa0e1142b04f856369.zip |
Small fixes.
-rw-r--r-- | sources/scala/collection/Map.scala | 3 | ||||
-rw-r--r-- | sources/scala/collection/Set.scala | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/sources/scala/collection/Map.scala b/sources/scala/collection/Map.scala index 1bb586ef07..343e4d342a 100644 --- a/sources/scala/collection/Map.scala +++ b/sources/scala/collection/Map.scala @@ -4,10 +4,9 @@ ** __\ \/ /__/ __ |/ /__/ __ | ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** +** $Id$ \* */ -// $Id$ - package scala.collection; diff --git a/sources/scala/collection/Set.scala b/sources/scala/collection/Set.scala index cb8a47c466..705a3d24ad 100644 --- a/sources/scala/collection/Set.scala +++ b/sources/scala/collection/Set.scala @@ -23,7 +23,7 @@ package scala.collection; * @author Matthias Zenger * @version 1.0, 08/07/2003 */ -trait Set[A] with Iterable[A] { +trait Set[A] with Function1[A, Boolean] with Iterable[A] { /** Returns the number of elements in this set. * @@ -38,6 +38,14 @@ trait Set[A] with Iterable[A] { */ def contains(elem: A): Boolean; + /** This method allows sets to be interpreted as predicates. + * It returns true, iff this set contains element <code>elem</code>. + * + * @param elem the element to check for membership. + * @return true, iff <code>elem</code> is contained in this set. + */ + def apply(elem: A): Boolean = contains(elem); + /** Checks if this set is empty. * * @return true, iff there is no element in the set. |