[libgee] Rename Iterator.at_element to Iterator.valid
- From: Maciej Marcin Piechotka <mpiechotka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgee] Rename Iterator.at_element to Iterator.valid
- Date: Sun, 17 Oct 2010 16:52:26 +0000 (UTC)
commit c18dd4e401e0fff6db8fae09982ea14f7da3ca69
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date: Sun Oct 17 17:51:10 2010 +0100
Rename Iterator.at_element to Iterator.valid
gee/abstractmultiset.vala | 4 ++--
gee/arraylist.vala | 2 +-
gee/hashmap.vala | 2 +-
gee/hashset.vala | 2 +-
gee/iterator.vala | 4 ++--
gee/linkedlist.vala | 2 +-
gee/mapiterator.vala | 2 +-
gee/priorityqueue.vala | 2 +-
gee/readonlycollection.vala | 4 ++--
gee/readonlymap.vala | 4 ++--
gee/treemap.vala | 2 +-
gee/treeset.vala | 6 +++---
tests/testcollection.vala | 20 ++++++++++----------
13 files changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/gee/abstractmultiset.vala b/gee/abstractmultiset.vala
index 14a9eff..09804b3 100644
--- a/gee/abstractmultiset.vala
+++ b/gee/abstractmultiset.vala
@@ -133,9 +133,9 @@ public abstract class Gee.AbstractMultiSet<G> : AbstractCollection<G>, MultiSet<
_removed = true;
}
- public bool at_element {
+ public bool valid {
get {
- return ! _removed && _iter.at_element;
+ return ! _removed && _iter.valid;
}
}
}
diff --git a/gee/arraylist.vala b/gee/arraylist.vala
index 4bf0f5a..949367f 100644
--- a/gee/arraylist.vala
+++ b/gee/arraylist.vala
@@ -362,7 +362,7 @@ public class Gee.ArrayList<G> : AbstractList<G> {
return _index;
}
- public bool at_element {
+ public bool valid {
get {
stderr.printf ("%d %s\n", _index, _removed ? "true" : "false");
return _index >= 0 && _index < _list._size && ! _removed;
diff --git a/gee/hashmap.vala b/gee/hashmap.vala
index 9aec84c..838ea5c 100644
--- a/gee/hashmap.vala
+++ b/gee/hashmap.vala
@@ -492,7 +492,7 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
return (_next != null);
}
- public bool at_element {
+ public bool valid {
get {
return _node != null;
}
diff --git a/gee/hashset.vala b/gee/hashset.vala
index 052e62e..073cbd0 100644
--- a/gee/hashset.vala
+++ b/gee/hashset.vala
@@ -260,7 +260,7 @@ public class Gee.HashSet<G> : AbstractSet<G> {
_stamp = _set._stamp;
}
- public bool at_element {
+ public bool valid {
get {
return _node != null;
}
diff --git a/gee/iterator.vala b/gee/iterator.vala
index 48c749e..0b02dae 100644
--- a/gee/iterator.vala
+++ b/gee/iterator.vala
@@ -71,7 +71,7 @@ public interface Gee.Iterator<G> : Object {
* Determines wheather the call to { link get} is legal. It is false at the
* beginning and after { link remove} call and true otherwise.
*/
- public abstract bool at_element { get; }
+ public abstract bool valid { get; }
/**
* Standard aggragation function.
@@ -84,7 +84,7 @@ public interface Gee.Iterator<G> : Object {
*/
public virtual A fold<A> (FoldFunc<A, G> f, owned A seed)
{
- if (at_element)
+ if (valid)
seed = f (get (), (owned) seed);
while (next ())
seed = f (get (), (owned) seed);
diff --git a/gee/linkedlist.vala b/gee/linkedlist.vala
index a991e6c..842e1c7 100644
--- a/gee/linkedlist.vala
+++ b/gee/linkedlist.vala
@@ -571,7 +571,7 @@ public class Gee.LinkedList<G> : AbstractList<G>, Queue<G>, Deque<G> {
return this._index;
}
- public bool at_element {
+ public bool valid {
get {
return !this.removed && this.position != null;
}
diff --git a/gee/mapiterator.vala b/gee/mapiterator.vala
index 3f5e9c2..3f7b391 100644
--- a/gee/mapiterator.vala
+++ b/gee/mapiterator.vala
@@ -81,6 +81,6 @@ public interface Gee.MapIterator<K,V> : Object {
* { link set_value} is legal. It is false at the beginning and after
* { link unset} call and true otherwise.
*/
- public abstract bool at_element { get; }
+ public abstract bool valid { get; }
}
diff --git a/gee/priorityqueue.vala b/gee/priorityqueue.vala
index 75ae27b..d4535b9 100644
--- a/gee/priorityqueue.vala
+++ b/gee/priorityqueue.vala
@@ -1007,7 +1007,7 @@ public class Gee.PriorityQueue<G> : Gee.AbstractQueue<G> {
}
- public bool at_element {
+ public bool valid {
get {
return started && ! removed && position != null;
}
diff --git a/gee/readonlycollection.vala b/gee/readonlycollection.vala
index fb563bb..4d80620 100644
--- a/gee/readonlycollection.vala
+++ b/gee/readonlycollection.vala
@@ -159,9 +159,9 @@ internal class Gee.ReadOnlyCollection<G> : Object, Iterable<G>, Collection<G> {
assert_not_reached ();
}
- public bool at_element {
+ public bool valid {
get {
- return _iter.at_element;
+ return _iter.valid;
}
}
}
diff --git a/gee/readonlymap.vala b/gee/readonlymap.vala
index f0f7150..cb22c94 100644
--- a/gee/readonlymap.vala
+++ b/gee/readonlymap.vala
@@ -246,9 +246,9 @@ internal class Gee.ReadOnlyMap<K,V> : Object, Iterable<Map.Entry<K,V>>, Map<K,V>
assert_not_reached ();
}
- public bool at_element {
+ public bool valid {
get {
- return _iter.at_element;
+ return _iter.valid;
}
}
}
diff --git a/gee/treemap.vala b/gee/treemap.vala
index a8a9b7f..c3ae7c3 100644
--- a/gee/treemap.vala
+++ b/gee/treemap.vala
@@ -707,7 +707,7 @@ public class Gee.TreeMap<K,V> : Gee.AbstractMap<K,V> {
assert (stamp == _map.stamp);
}
- public bool at_element {
+ public bool valid {
get {
return current != null;
}
diff --git a/gee/treeset.vala b/gee/treeset.vala
index 412f988..7bf3b07 100644
--- a/gee/treeset.vala
+++ b/gee/treeset.vala
@@ -698,7 +698,7 @@ public class Gee.TreeSet<G> : AbstractSet<G>, SortedSet<G> {
}
}
- public bool at_element {
+ public bool valid {
get {
assert (stamp == _set.stamp);
return current != null;
@@ -1073,9 +1073,9 @@ public class Gee.TreeSet<G> : AbstractSet<G>, SortedSet<G> {
iterator.remove ();
}
- public bool at_element {
+ public bool valid {
get {
- return iterator.at_element;
+ return iterator.valid;
}
}
diff --git a/tests/testcollection.vala b/tests/testcollection.vala
index 0f2be80..c8dd361 100644
--- a/tests/testcollection.vala
+++ b/tests/testcollection.vala
@@ -78,19 +78,19 @@ public abstract class CollectionTests : Gee.TestCase {
bool two_found_once = true;
bool three_found_once = true;
iterator = test_collection.iterator ();
- bool at_element = iterator.at_element;
- assert (! at_element);
+ bool valid = iterator.valid;
+ assert (! valid);
while (true) {
has_next = iterator.has_next ();
- assert (at_element == iterator.at_element);
+ assert (valid == iterator.valid);
assert (has_next == iterator.next ());
- assert (at_element = iterator.at_element);
+ assert (valid = iterator.valid);
if (! has_next) {
break;
}
string element = iterator.get ();
- assert (iterator.at_element);
+ assert (iterator.valid);
if (element == "one") {
if (one_found) {
one_found_once = false;
@@ -110,9 +110,9 @@ public abstract class CollectionTests : Gee.TestCase {
}
has_next = iterator.has_next ();
assert (! has_next);
- assert (iterator.at_element);
+ assert (iterator.valid);
assert (has_next == iterator.next ());
- assert (iterator.at_element);
+ assert (iterator.valid);
assert (one_found);
assert (one_found_once);
assert (two_found);
@@ -122,7 +122,7 @@ public abstract class CollectionTests : Gee.TestCase {
iterator = test_collection.iterator ();
assert (iterator.has_next ());
- assert (! iterator.at_element);
+ assert (! iterator.valid);
assert (iterator.next ());
one_found = false;
@@ -194,7 +194,7 @@ public abstract class CollectionTests : Gee.TestCase {
if (! has_next) {
break;
}
- assert (iterator.at_element);
+ assert (iterator.valid);
string element = iterator.get ();
if (element == "one") {
@@ -210,7 +210,7 @@ public abstract class CollectionTests : Gee.TestCase {
// Remove this element
iterator.remove ();
- assert (! iterator.at_element);
+ assert (! iterator.valid);
} else if (element == "three") {
if (three_found) {
three_found_once = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]