lib: MapIterator is no more an Iterator
authorJean Privat <jean@pryen.org>
Fri, 10 Feb 2012 16:32:35 +0000 (11:32 -0500)
committerJean Privat <jean@pryen.org>
Mon, 13 Feb 2012 19:04:52 +0000 (14:04 -0500)
One more step to detach Map from the Collection hierarchy.

Signed-off-by: Jean Privat <jean@pryen.org>

lib/standard/collection/abstract_collection.nit

index 9fb7cfd..cd6c734 100644 (file)
@@ -325,10 +325,21 @@ end
 
 # Iterators for Map.
 interface MapIterator[K: Object, E]
-       super Iterator[E]
+       # The current item.
+       # Require `is_ok'.
+       fun item: E is abstract
+
        # The key of the current item.
+       # Require `is_ok'.
        fun key: K is abstract
 
+       # Jump to the next item.
+       # Require `is_ok'.
+       fun next is abstract
+
+       # Is there a current item ?
+       fun is_ok: Bool is abstract
+
        # Set a new `item' at `key'.
        #fun item=(item: E) is abstract
 end