From f814b3162e06898c359cea623e3dd0f82df0d4ed Mon Sep 17 00:00:00 2001 From: Sean McDirmid Date: Fri, 24 Nov 2006 13:12:57 +0000 Subject: Map.scala: added simple keySet method. Trees.scala: added &~ operator to flags. Signatures.scala: trying to ignore synthetic flag in computed signatures. Infer.scala: fixed bug where dependency was being attributed to wrong unit. --- src/library/scala/collection/Map.scala | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/library') diff --git a/src/library/scala/collection/Map.scala b/src/library/scala/collection/Map.scala index 211158f047..ad3dc29380 100644 --- a/src/library/scala/collection/Map.scala +++ b/src/library/scala/collection/Map.scala @@ -76,6 +76,14 @@ trait Map[A, +B] extends AnyRef case Some(_) => true } + /** @return the keys of this map as a set. + */ + def keySet = new Set[A] { + def size = Map.this.size; + def contains(key : A) = Map.this.contains(key); + def elements = Map.this.elements.map(._1); + } + /** Does this map contain a mapping from the given key to a value? * * @param key the key -- cgit v1.2.3