lib/map: add factory to Map returning a HashMap
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 18 Dec 2014 15:31:56 +0000 (10:31 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 13 Jan 2015 19:09:54 +0000 (14:09 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/standard/collection/hash_collection.nit

index cae46fd..f385729 100644 (file)
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
 # another product.
 
-# Introduce Hashmap and Hashset.
+# Introduce `HashMap` and `HashSet`.
 module hash_collection
 
 import array
 
+redef class Map[K, V]
+       # Get a `HashMap[K, V]` as default implementation
+       new do return new HashMap[K, V]
+end
+
 # A HashCollection is an array of HashNode[K] indexed by the K hash value
 private abstract class HashCollection[K]
        type N: HashNode[K]