metamodel: rename 'universal' to 'enum'
[nit.git] / lib / standard / collection / array.nit
index fa99224..133ea5b 100644 (file)
@@ -19,7 +19,7 @@ import abstract_collection
 
 # One dimention array of objects.
 class AbstractArrayRead[E]
-special SequenceRead[E]
+       super SequenceRead[E]
        # The current length
        redef readable var _length: Int = 0
 
@@ -142,8 +142,8 @@ end
 
 # Resizeable one dimention array of objects.
 class AbstractArray[E]
-special AbstractArrayRead[E]
-special Sequence[E]
+       super AbstractArrayRead[E]
+       super Sequence[E]
        fun enlarge(cap: Int) is abstract
 
        redef fun push(item) do add(item)
@@ -226,8 +226,8 @@ end
 #     a.push(32)
 #     a.push(8)
 class Array[E]
-special AbstractArray[E]
-special ArrayCapable[E]
+       super AbstractArray[E]
+       super ArrayCapable[E]
        redef fun iterate
                !each(e: E)
        do
@@ -391,7 +391,7 @@ end
 
 # An `Iterator' on `AbstractArray'
 class ArrayIterator[E]
-special IndexedIterator[E]
+       super IndexedIterator[E]
        redef fun item do return _array[_index]
 
        # redef fun item=(e) do _array[_index] = e
@@ -413,8 +413,8 @@ end
 # Others collections ##########################################################
 
 # A set implemented with an Array.
-class ArraySet[E]
-special Set[E]
+class ArraySet[E: Object]
+       super Set[E]
        # The stored elements.
        var _array: Array[E]
 
@@ -461,8 +461,8 @@ special Set[E]
 end
 
 # Iterators on sets implemented with arrays.
-class ArraySetIterator[E]
-special Iterator[E]
+class ArraySetIterator[E: Object]
+       super Iterator[E]
 
        redef fun is_ok do return _iter.is_ok
 
@@ -477,8 +477,8 @@ end
 
 
 # Associative arrays implemented with an array of (key, value) pairs.
-class ArrayMap[K, E]
-special CoupleMap[K, E]
+class ArrayMap[K: Object, E]
+       super CoupleMap[K, E]
 
        # O(n)
        redef fun [](key)
@@ -522,7 +522,7 @@ special CoupleMap[K, E]
        # O(1)
        redef fun length do return _items.length
 
-       redef fun first do return _items.first.first
+       redef fun first do return _items.first.second
 
        # O(n)
        redef fun count(item)