[libgee/future-abi: 1/2] Future ABI part 1
- From: Jeremy Whiting <jpwhiting src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgee/future-abi: 1/2] Future ABI part 1
- Date: Fri, 3 Aug 2012 21:55:07 +0000 (UTC)
commit 6b8b60657306b437f6a40803a5e9ac7157af4011
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date: Mon Jul 16 01:22:35 2012 -0700
Future ABI part 1
gee/abstractcollection.vala | 8 ------
gee/abstractmap.vala | 14 ----------
gee/abstractmultiset.vala | 8 ------
gee/arraylist.vala | 8 ------
gee/arrayqueue.vala | 8 ------
gee/concurrentlist.vala | 8 ------
gee/hashmap.vala | 24 -----------------
gee/hashset.vala | 8 ------
gee/linkedlist.vala | 8 ------
gee/priorityqueue.vala | 8 ------
gee/traversable.vala | 59 ++++++++++++------------------------------
gee/treemap.vala | 48 -----------------------------------
gee/treeset.vala | 16 -----------
gee/unfolditerator.vala | 8 ------
14 files changed, 17 insertions(+), 216 deletions(-)
---
diff --git a/gee/abstractcollection.vala b/gee/abstractcollection.vala
index e130fac..a31cf77 100644
--- a/gee/abstractcollection.vala
+++ b/gee/abstractcollection.vala
@@ -292,14 +292,6 @@ public abstract class Gee.AbstractCollection<G> : Object, Traversable<G>, Iterab
return iterator ().stream<A> ((owned) f);
}
- public virtual Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned) f);
- }
-
- public virtual Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
-
private weak Collection<G> _read_only_view;
/**
diff --git a/gee/abstractmap.vala b/gee/abstractmap.vala
index 33a1ab6..e281f49 100644
--- a/gee/abstractmap.vala
+++ b/gee/abstractmap.vala
@@ -216,18 +216,4 @@ public abstract class Gee.AbstractMap<K,V> : Object, Traversable<Map.Entry<K,V>>
public virtual Iterator<A> stream<A> (owned StreamFunc<Map.Entry<K,V>, A> f) {
return iterator ().stream<A> ((owned) f);
}
-
- /**
- * { inheritDoc}
- */
- public virtual Iterator<Map.Entry<K,V>> filter (owned Predicate<Map.Entry<K,V>> f) {
- return Traversable.filter_impl<Map.Entry<K,V>> (this, (owned)f);
- }
-
- /**
- * { inheritDoc}
- */
- public virtual Iterator<Map.Entry<K,V>> chop (int offset, int length = -1) {
- return Traversable.chop_impl<Map.Entry<K,V>> (this, offset, length);
- }
}
diff --git a/gee/abstractmultiset.vala b/gee/abstractmultiset.vala
index 147fb7e..1a5e55b 100644
--- a/gee/abstractmultiset.vala
+++ b/gee/abstractmultiset.vala
@@ -169,13 +169,5 @@ public abstract class Gee.AbstractMultiSet<G> : AbstractCollection<G>, MultiSet<
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, G> f) {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
-
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
}
}
diff --git a/gee/arraylist.vala b/gee/arraylist.vala
index 3f7018e..4b41ea1 100644
--- a/gee/arraylist.vala
+++ b/gee/arraylist.vala
@@ -406,14 +406,6 @@ public class Gee.ArrayList<G> : AbstractBidirList<G> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, G> f) {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
-
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
}
}
diff --git a/gee/arrayqueue.vala b/gee/arrayqueue.vala
index 2ab16b4..e19618b 100644
--- a/gee/arrayqueue.vala
+++ b/gee/arrayqueue.vala
@@ -326,14 +326,6 @@ public class Gee.ArrayQueue<G> : Gee.AbstractQueue<G>, Deque<G> {
return Gee.Iterator.stream_impl<G, A> (this, (owned)f);
}
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
-
private ArrayQueue _queue;
private int _stamp;
private int _offset = -1;
diff --git a/gee/concurrentlist.vala b/gee/concurrentlist.vala
index e57c7ec..3717903 100644
--- a/gee/concurrentlist.vala
+++ b/gee/concurrentlist.vala
@@ -361,14 +361,6 @@ public class Gee.ConcurrentList<G> : AbstractList<G> {
return Gee.Iterator.stream_impl<G, A> (this, (owned)f);
}
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
-
private bool _started;
private bool _removed;
private int _index;
diff --git a/gee/hashmap.vala b/gee/hashmap.vala
index 73fa68d..8832a36 100644
--- a/gee/hashmap.vala
+++ b/gee/hashmap.vala
@@ -572,14 +572,6 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, K> f) {
return Gee.Iterator.stream_impl<K, A>(this, (owned)f);
}
-
- public Gee.Iterator<K> filter (owned Predicate<K> f) {
- return Traversable.filter_impl<K> (this, (owned)f);
- }
-
- public Gee.Iterator<K> chop (int offset, int length = -1) {
- return Traversable.chop_impl<K> (this, offset, length);
- }
}
private class MapIterator<K,V> : NodeIterator<K,V>, Gee.MapIterator<K,V> {
@@ -669,14 +661,6 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, V> f) {
return Gee.Iterator.stream_impl<V, A>(this, (owned)f);
}
-
- public Gee.Iterator<V> filter (owned Predicate<V> f) {
- return Traversable.filter_impl<V> (this, (owned)f);
- }
-
- public Gee.Iterator<V> chop (int offset, int length = -1) {
- return Traversable.chop_impl<V> (this, offset, length);
- }
}
private class EntryIterator<K,V> : NodeIterator<K,V>, Traversable<Map.Entry<K,V>>, Iterator<Map.Entry<K,V>> {
@@ -720,14 +704,6 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<Map.Entry<K,V>, A> f) {
return Gee.Iterator.stream_impl<Map.Entry<K,V>, A>(this, (owned)f);
}
-
- public Gee.Iterator<Map.Entry<K,V>> filter (owned Predicate<Map.Entry<K,V>> f) {
- return Traversable.filter_impl<Map.Entry<K,V>> (this, (owned)f);
- }
-
- public Iterator<Map.Entry<K,V>> chop (int offset, int length = -1) {
- return Traversable.chop_impl<Map.Entry<K,V>> (this, offset, length);
- }
}
}
diff --git a/gee/hashset.vala b/gee/hashset.vala
index 9272aa2..7632bb2 100644
--- a/gee/hashset.vala
+++ b/gee/hashset.vala
@@ -309,14 +309,6 @@ public class Gee.HashSet<G> : AbstractSet<G> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, G> f) {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
-
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
}
}
diff --git a/gee/linkedlist.vala b/gee/linkedlist.vala
index 575c63b..6b026db 100644
--- a/gee/linkedlist.vala
+++ b/gee/linkedlist.vala
@@ -627,14 +627,6 @@ public class Gee.LinkedList<G> : AbstractBidirList<G>, Queue<G>, Deque<G> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, G> f) {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
-
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
}
private unowned Node<G>? _get_node_at (int index) {
diff --git a/gee/priorityqueue.vala b/gee/priorityqueue.vala
index e40676b..7253ca6 100644
--- a/gee/priorityqueue.vala
+++ b/gee/priorityqueue.vala
@@ -1049,13 +1049,5 @@ public class Gee.PriorityQueue<G> : Gee.AbstractQueue<G> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, G> f) {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
-
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
}
}
diff --git a/gee/traversable.vala b/gee/traversable.vala
index 82a46ab..d31ffc5 100644
--- a/gee/traversable.vala
+++ b/gee/traversable.vala
@@ -215,8 +215,6 @@ public interface Gee.Traversable<G> : Object {
* Creates a new iterator that contains only values that fullfills the
* predicate.
*
- * Note: There is implementation { link filter_impl}.
- *
* Note: When the method is called on { link Iterator} using the parent
* iterator is not allowed befor the inner iterator
* { link Iterator.next} return false and then it points on its last
@@ -227,40 +225,8 @@ public interface Gee.Traversable<G> : Object {
* @param f Folding function
* @return Iterator containing values of subsequent values of seed
*/
- public abstract Iterator<G> filter (owned Predicate<G> f);
-
- /**
- * Creates a new iterator which contains elements from iterable. The
- * first argument states the offset i.e. number of elements the iterator
- * skips by default.
- *
- * Note: There is implementation { link chop_impl}.
- *
- * Note: In { link Iterator} implementation resulting iterator is
- * { link Iterator.valid} when parent iterator is
- * { link Iterator.valid} and the offset is 0. Using the parent
- * iterator is not allowed before the inner iterator
- * { link Iterator.next} return false and then it points on its last
- * element.
- *
- * @param offset the offset to first element the iterator is pointing to
- * @param length maximum number of elements iterator may return. Negative
- * value means that the number is unbounded
- */
- public abstract Iterator<G> chop (int offset, int length = -1);
-
-
- /**
- * Implementation based on { link stream} for { link filter}.
- *
- * @param input The current Traversable
- * @param pred Predicate
- * @return Filtered iterator
- * @see filter
- * @see stream
- */
- public static Iterator<G> filter_impl<G> (Traversable<G> input, owned Predicate<G> pred) {
- return input.stream<G> ((state, item, out val) => {
+ public virtual Iterator<G> filter (owned Predicate<G> pred) {
+ return stream<G> ((state, item, out val) => {
switch (state) {
case Stream.YIELD:
val = null;
@@ -284,15 +250,24 @@ public interface Gee.Traversable<G> : Object {
}
/**
- * Implementation based on { link stream} for { link filter}.
+ * Creates a new iterator which contains elements from iterable. The
+ * first argument states the offset i.e. number of elements the iterator
+ * skips by default.
+ *
+ * Note: In { link Iterator} implementation resulting iterator is
+ * { link Iterator.valid} when parent iterator is
+ * { link Iterator.valid} and the offset is 0. Using the parent
+ * iterator is not allowed before the inner iterator
+ * { link Iterator.next} return false and then it points on its last
+ * element.
*
- * @param input The current Traversable
- * @param offset The offset
- * @param length The length
+ * @param offset the offset to first element the iterator is pointing to
+ * @param length maximum number of elements iterator may return. Negative
+ * value means that the number is unbounded
*/
- public static Iterator<G> chop_impl<G> (Traversable<G> input, int offset, int length) {
+ public virtual Iterator<G> chop (int offset, int length = -1) {
assert (offset >= 0);
- return input.stream<G> ((state, item, out val) => {
+ return stream<G> ((state, item, out val) => {
switch (state) {
case Stream.YIELD:
val = null;
diff --git a/gee/treemap.vala b/gee/treemap.vala
index 8bc869e..f27b866 100644
--- a/gee/treemap.vala
+++ b/gee/treemap.vala
@@ -1654,14 +1654,6 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, K> f) {
return Gee.Iterator.stream_impl<K, A>(this, (owned)f);
}
-
- public Gee.Iterator<K> filter (owned Predicate<K> f) {
- return Traversable.filter_impl<K> (this, (owned)f);
- }
-
- public Gee.Iterator<K> chop (int offset, int length = -1) {
- return Traversable.chop_impl<K> (this, offset, length);
- }
}
private class SubKeyIterator<K,V> : SubNodeIterator<K,V>, Traversable<K>, Gee.Iterator<K>, BidirIterator<K> {
@@ -1692,14 +1684,6 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, K> f) {
return Gee.Iterator.stream_impl<K, A>(this, (owned)f);
}
-
- public Gee.Iterator<K> filter (owned Predicate<K> f) {
- return Traversable.filter_impl<K> (this, (owned)f);
- }
-
- public Gee.Iterator<K> chop (int offset, int length = -1) {
- return Traversable.chop_impl<K> (this, offset, length);
- }
}
private class ValueIterator<K,V> : NodeIterator<K,V>, Traversable<V>, Gee.Iterator<V>, Gee.BidirIterator<V> {
@@ -1742,14 +1726,6 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, V> f) {
return Gee.Iterator.stream_impl<V, A>(this, (owned)f);
}
-
- public Gee.Iterator<V> filter (owned Predicate<V> f) {
- return Traversable.filter_impl<V> (this, (owned)f);
- }
-
- public Gee.Iterator<V> chop (int offset, int length = -1) {
- return Traversable.chop_impl<V> (this, offset, length);
- }
}
private class SubValueIterator<K,V> : SubNodeIterator<K,V>, Traversable<V>, Gee.Iterator<V>, BidirIterator<V> {
@@ -1780,14 +1756,6 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, V> f) {
return Gee.Iterator.stream_impl<V, A>(this, (owned)f);
}
-
- public Gee.Iterator<V> filter (owned Predicate<V> f) {
- return Traversable.filter_impl<V> (this, (owned)f);
- }
-
- public Gee.Iterator<V> chop (int offset, int length = -1) {
- return Traversable.chop_impl<V> (this, offset, length);
- }
}
private class EntryIterator<K,V> : NodeIterator<K,V>, Traversable<Map.Entry<K, V>>, Gee.Iterator<Map.Entry<K,V>>, Gee.BidirIterator<Map.Entry<K,V>> {
@@ -1834,14 +1802,6 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<Map.Entry<K, V>, A> f) {
return Gee.Iterator.stream_impl<Map.Entry<K, V>, A>(this, (owned)f);
}
-
- public Gee.Iterator<Map.Entry<K, V>> filter (owned Predicate<Map.Entry<K, V>> f) {
- return Traversable.filter_impl<Map.Entry<K, V>> (this, (owned)f);
- }
-
- public Gee.Iterator<Map.Entry<K, V>> chop (int offset, int length = -1) {
- return Traversable.chop_impl<Map.Entry<K, V>> (this, offset, length);
- }
}
private class SubEntryIterator<K,V> : SubNodeIterator<K,V>, Traversable<Map.Entry<K, V>>, Gee.Iterator<Map.Entry<K,V>>, Gee.BidirIterator<Map.Entry<K,V>> {
@@ -1876,14 +1836,6 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
public Gee.Iterator<A> stream<A> (owned StreamFunc<Map.Entry<K, V>, A> f) {
return Gee.Iterator.stream_impl<Map.Entry<K, V>, A>(this, (owned)f);
}
-
- public Gee.Iterator<Map.Entry<K, V>> filter (owned Predicate<Map.Entry<K, V>> f) {
- return Traversable.filter_impl<Map.Entry<K, V>> (this, (owned)f);
- }
-
- public Gee.Iterator<Map.Entry<K, V>> chop (int offset, int length = -1) {
- return Traversable.chop_impl<Map.Entry<K, V>> (this, offset, length);
- }
}
private class MapIterator<K,V> : NodeIterator<K,V>, Gee.MapIterator<K,V>, BidirMapIterator<K,V> {
diff --git a/gee/treeset.vala b/gee/treeset.vala
index 8387b1c..eb97d81 100644
--- a/gee/treeset.vala
+++ b/gee/treeset.vala
@@ -738,14 +738,6 @@ public class Gee.TreeSet<G> : AbstractBidirSortedSet<G> {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
-
private weak Node<G>? current = null;
private weak Node<G>? _next = null;
private weak Node<G>? _prev = null;
@@ -1145,14 +1137,6 @@ public class Gee.TreeSet<G> : AbstractBidirSortedSet<G> {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
- public Gee.Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Gee.Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
-
private new TreeSet<G> set;
private Range<G> range;
private Iterator<G>? iterator = null;
diff --git a/gee/unfolditerator.vala b/gee/unfolditerator.vala
index fb8aa80..3a4c6c6 100644
--- a/gee/unfolditerator.vala
+++ b/gee/unfolditerator.vala
@@ -94,14 +94,6 @@ internal class Gee.UnfoldIterator<G> : Object, Traversable<G>, Iterator<G> {
return Iterator.stream_impl<G, A>(this, (owned)f);
}
- public Iterator<G> filter (owned Predicate<G> f) {
- return Traversable.filter_impl<G> (this, (owned)f);
- }
-
- public Iterator<G> chop (int offset, int length = -1) {
- return Traversable.chop_impl<G> (this, offset, length);
- }
-
private UnfoldFunc<G> _func;
private Lazy<G>? _current;
private Lazy<G>? _next;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]