_storage_map.clear ();
_nitems = 0;
}
+
+ public Type key_type { get { return typeof(K); } }
+
+ public Type value_type { get { return typeof(V); } }
}
_removed = false;
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public Gee.Iterator<A> stream<A> (owned StreamFunc<A, G> f) {
return Gee.Iterator.stream_impl<G, A>(this, (owned)f);
}
}
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public void foreach (ForallFunc<G> f) {
assert (_stamp == _list._stamp);
if (_index < 0 || _removed)
_index++;
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public new void foreach (ForallFunc<G> f) {
HazardPointer.Context ctx = new HazardPointer.Context ();
if (_started && !_removed)
assert_not_reached ();
}
+ public Type element_type {
+ get { return typeof (K); }
+ }
+
public void foreach(ForallFunc<K> f) {
if (_node != null) {
f(_node.key);
assert_not_reached ();
}
+ public Type element_type {
+ get { return typeof (V); }
+ }
+
public void foreach(ForallFunc<V> f) {
if (_node != null) {
f(_node.value);
assert_not_reached ();
}
+ public Type element_type {
+ get { return typeof (Entry<K, V>); }
+ }
+
public void foreach(ForallFunc<Map.Entry<K,V>> f) {
if (_node != null) {
f(Entry<K,V>.entry_for<K,V> (_node));
}
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public void foreach (ForallFunc<G> f) {
assert (_stamp == _set._stamp);
if (_node != null)
}
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public void foreach (ForallFunc<G> f) {
assert (_stamp == _list._stamp);
if (!started) {
* Removes all items from this collection.
*/
public abstract void clear ();
+
+ /**
+ * The type of the keys in this multimap.
+ */
+ public abstract Type key_type { get; }
+
+ /**
+ * The type of the values in this multimap.
+ */
+ public abstract Type value_type { get; }
}
}
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public void foreach (ForallFunc<G> f) {
if (valid)
f (position.data);
public void remove () {
assert_not_reached ();
}
-
+
public bool valid {
get {
return _iter.valid;
}
}
-
+
public bool read_only {
get {
return true;
}
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public void foreach (ForallFunc<G> f) {
_iter.foreach (f);
}
*
* @since 0.7.0
*/
-public interface Gee.Traversable<G> : Object
-{
+public interface Gee.Traversable<G> : Object {
/**
* Apply function to each element returned by iterator.
*
return current.key;
}
+ public Type element_type {
+ get { return typeof (K); }
+ }
+
public void foreach (ForallFunc<K> f) {
if (current != null) {
f (current.key);
return iterator.current.key;
}
+ public Type element_type {
+ get { return typeof (K); }
+ }
+
public void foreach (ForallFunc<K> f) {
if (valid)
f (iterator.current.key);
return current.value;
}
+ public Type element_type {
+ get { return typeof (V); }
+ }
+
public void foreach (ForallFunc<V> f) {
if (current != null) {
f (current.key);
return iterator.current.value;
}
+ public Type element_type {
+ get { return typeof (V); }
+ }
+
public void foreach (ForallFunc<V> f) {
if (valid)
f (iterator.current.key);
unset ();
}
+ public Type element_type {
+ get { return typeof (Entry<K, V>); }
+ }
+
public void foreach (ForallFunc<Map.Entry<K, V>> f) {
if (current != null) {
f (Entry.entry_for<K,V> (current));
unset ();
}
+ public Type element_type {
+ get { return typeof (Entry<K, V>); }
+ }
+
public void foreach (ForallFunc<Map.Entry<K, V>> f) {
if (valid)
f (Entry.entry_for<K,V> (iterator.current));
}
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public void foreach (ForallFunc<G> f) {
assert (stamp == _set.stamp);
if (current != null) {
}
}
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
public void foreach(ForallFunc<G> f) {
if(valid)
f(get());
public bool valid { get { return _current != null; } }
public bool read_only { get { return true; } }
- public void foreach (ForallFunc f) {
+ public Type element_type {
+ get { return typeof (G); }
+ }
+
+ public void foreach (ForallFunc<G> f) {
if (_current != null) {
f (_current);
}
public MultiMapTests (string name) {
base (name);
+ add_test ("[MultiMap] type correctness", test_type_correctness);
add_test ("[MultiMap] size", test_size);
add_test ("[MultiMap] getting and setting", test_getting_setting);
add_test ("[MultiMap] keys, all keys and values", test_keys_all_keys_values);
protected MultiMap<string,string> test_multi_map;
+ public void test_type_correctness () {
+ // Check the multimap exists
+ assert (test_multi_map != null);
+
+ // Check the advertised key and value types
+ assert (test_multi_map.key_type == typeof (string));
+ assert (test_multi_map.value_type == typeof (string));
+ }
+
private void test_size () {
// Check the map exists
assert (test_multi_map != null);