public virtual bool unset_all (Map<K,V> map) {
bool changed = false;
foreach (K key in map.keys) {
- changed = changed | remove (key);
+ changed = changed | unset (key);
}
return changed;
}
}
public bool contains (K key) {
- return _storage_map.contains (key);
+ return _storage_map.has_key (key);
}
public new Collection<V> get (K key) {
- if (_storage_map.contains (key)) {
+ if (_storage_map.has_key (key)) {
return _storage_map.get (key).read_only_view;
} else {
return _empty_value_set;
}
public new void set (K key, V value) {
- if (_storage_map.contains (key)) {
+ if (_storage_map.has_key (key)) {
if (_storage_map.get (key).add (value)) {
_nitems++;
}
}
public bool remove (K key, V value) {
- if (_storage_map.contains (key)) {
+ if (_storage_map.has_key (key)) {
var values = _storage_map.get (key);
if (values.contains (value)) {
values.remove (value);
_nitems--;
if (values.size == 0) {
- _storage_map.remove (key);
+ _storage_map.unset (key);
}
return true;
}
}
public bool remove_all (K key) {
- if (_storage_map.contains (key)) {
+ if (_storage_map.has_key (key)) {
int size = _storage_map.get (key).size;
- if (_storage_map.remove (key)) {
+ if (_storage_map.unset (key)) {
_nitems -= size;
return true;
}
public int count (G item) {
int result = 0;
- if (_storage_map.contains (item)) {
+ if (_storage_map.has_key (item)) {
result = _storage_map.get (item);
}
return result;
}
public override bool contains (G item) {
- return _storage_map.contains (item);
+ return _storage_map.has_key (item);
}
public override Gee.Iterator<G> iterator () {
}
public override bool add (G item) {
- if (_storage_map.contains (item)) {
+ if (_storage_map.has_key (item)) {
int current_count = _storage_map.get (item);
_storage_map.set (item, current_count + 1);
} else {
}
public override bool remove (G item) {
- if (_nitems > 0 && _storage_map.contains (item)) {
+ if (_nitems > 0 && _storage_map.has_key (item)) {
int current_count = _storage_map.get (item);
if (current_count <= 1) {
- _storage_map.remove (item);
+ _storage_map.unset (item);
} else {
_storage_map.set (item, current_count - 1);
}
}
public override bool contains (K key) {
- return _map.contains (key);
+ return _map.has_key (key);
}
public override bool add_all (Collection<K> collection) {
assert (_stamp == _map._stamp);
assert (_node != null);
has_next ();
- _map.remove (_node.key);
+ _map.unset (_node.key);
_node = null;
_stamp = _map._stamp;
}
*
* @deprecated Use {@link has_key} method instead.
*/
+ [Deprecated]
public abstract bool contains (K key);
/**
*
* @deprecated Use {@link unset} method instead.
*/
+ [Deprecated]
public abstract bool remove (K key, out V? value = null);
/**
*
* @deprecated Use {@link unset_all} method instead.
*/
+ [Deprecated]
public abstract bool remove_all (Map<K,V> map);
/**
*
* @deprecated Use {@link has_all} method instead.
*/
+ [Deprecated]
public abstract bool contains_all (Map<K,V> map);
/**
}
public override bool contains (K key) {
- return _map.contains (key);
+ return _map.has_key (key);
}
public override bool add_all (Collection<K> collection) {