lib: remove the now useless class NaiveCollection
authorJean Privat <jean@pryen.org>
Wed, 16 Oct 2013 16:29:35 +0000 (12:29 -0400)
committerJean Privat <jean@pryen.org>
Wed, 16 Oct 2013 16:29:35 +0000 (12:29 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

examples/circular_list.nit
lib/pipeline.nit
lib/standard/collection/abstract_collection.nit
src/poset.nit

index 86e41f6..c3ba1ed 100644 (file)
@@ -21,10 +21,6 @@ class CircularList[E]
        # Like standard Array or LinkedList, CircularList is a Sequence.
        super Sequence[E]
 
-       # NaiveCollection contains working (but inefficient) implementation of
-       # the methods of Collection.
-       super NaiveCollection[E]
-       
        # The first node of the list if any
        # The special case of an empty list is handled by a null node
        private var node: nullable CLNode[E] = null
index 81d68c5..3765d6a 100644 (file)
@@ -140,7 +140,7 @@ end
 ### Specific private collection and iterator classes
 
 private class PipeUniq[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        redef fun iterator do return new PipeUniqIterator[E](source.iterator)
 end
@@ -167,7 +167,7 @@ private class PipeUniqIterator[E]
 end
 
 private class PipeSeqUniq[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        redef fun iterator do return new PipeSeqUniqIterator[E](source.iterator)
 end
@@ -192,7 +192,7 @@ private class PipeSeqUniqIterator[E]
 end
 
 private class PipeJoin[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source1: Collection[E]
        var source2: Collection[E]
        redef fun iterator do return new PipeJoinIterator[E](source1.iterator, source2.iterator)
@@ -220,7 +220,7 @@ private class PipeJoinIterator[E]
 end
 
 private class PipeAlternate[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        var odd_item: E
        redef fun iterator do return new PipeAlternateIterator[E](source.iterator, odd_item)
@@ -254,14 +254,14 @@ private class PipeAlternateIterator[E]
 end
 
 private class PipeSkip[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        var skip_item: E
        redef fun iterator do return new PipeSkipIterator[E](source.iterator, skip_item)
 end
 
 private class PipeSkipIterator[E]
-       super NaiveCollection[E]
+       super Collection[E]
        super Iterator[E]
 
        var source: Iterator[E]
@@ -292,7 +292,7 @@ private class PipeSkipIterator[E]
 end
 
 private class PipeHead[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        var pipe_length: Int
        redef fun iterator do return new PipeHeadIterator[E](source.iterator, pipe_length)
@@ -317,7 +317,7 @@ private class PipeHeadIterator[E]
 end
 
 private class PipeSkipHead[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        var pipe_length: Int
        redef fun iterator
@@ -333,7 +333,7 @@ private class PipeSkipHead[E]
 end
 
 private class PipeTail[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        var pipe_length: Int
        redef fun iterator
@@ -351,7 +351,7 @@ private class PipeTail[E]
 end
 
 private class PipeSkipTail[E]
-       super NaiveCollection[E]
+       super Collection[E]
        var source: Collection[E]
        var pipe_length: Int
        redef fun iterator do return new PipeSkipTailIterator[E](source.iterator, pipe_length)
index 1298348..fcbd0f4 100644 (file)
@@ -134,12 +134,6 @@ interface Collection[E]
        end
 end
 
-# Naive implementation of collections method
-# You only have to define iterator!
-interface NaiveCollection[E]
-       super Collection[E]
-end
-
 # Instances of the Iterator class generates a series of elements, one at a time.
 # They are mainly used with collections.
 interface Iterator[E]
index 67b95e6..aea40bb 100644 (file)
@@ -23,7 +23,7 @@ module poset
 #  * reflexivity: an element is in relation with itself (ie `self.has(e) implies self.has_edge(e,e)`)
 #  * transitivity: `(self.has_edge(e,f) and self.has_edge(f,g)) implies self.has_edge(e,g)`
 class POSet[E: Object]
-       super NaiveCollection[E]
+       super Collection[E]
        super AbstractSorter[E]
 
        redef fun iterator do return elements.keys.iterator