AbstractMap
Object Hierarchy:
Description:
public abstract class AbstractMap<K
,V> :
Object,
Iterable<
Entry<
K?,
V?>>,
Map<
K?,
V?>
Skeletal implementation of the Map interface.
Contains common code shared by all map implementations.
See also:
HashMap, TreeMap
Namespace: Gee
Package: gee-1.0
Content:
Creation methods:
Properties:
-
public abstract int
size { get; }
The number of items in this map.
-
public virtual bool
is_empty { get; }
Specifies whether this map is empty.
-
public abstract
Set<K?>
keys { owned
get; }
The read-only view of the keys of this map.
-
public abstract
Collection<V?>
values { owned
get; }
The read-only view of the values of this map.
-
public abstract
Set<
Entry<K?,
V?>> entries {
owned get; }
The read-only view of the entries of this map.
-
public virtual
Map<K?,
V?>
read_only_view { owned
get; }
The read-only view this map.
-
public Type
key_type { get; }
The type of the keys in this map.
-
public Type
value_type { get; }
The type of the values in this map.
-
public Type
element_type { get; }
The type of the elements in this collection.
Methods:
-
public abstract bool
has_key (K? key)
Determines whether this map has the specified key.
-
public bool
contains (K? key)
Determines whether this map contains the specified key.
-
public abstract bool
has (K? key,
V? value)
Determines whether this map has the specified key/value entry.
-
public abstract V?
get (K? key)
Returns the value of the specified key in this map.
-
public abstract void
set (K? key,
V? value)
Inserts a new key and value into this map.
-
public abstract bool
unset (K? key,
out V? value = null)
Removes the specified key from this map.
-
public abstract
MapIterator<K?,
V?>
map_iterator ()
Returns an iterator for this map.
-
public bool
remove (K? key,
out V? value = null)
Removes the specified key from this map.
-
public abstract void
clear ()
Removes all items from this collection. Must not be called on read-only collections.
-
public virtual void
set_all (
Map<K?,
V?> map)
Inserts all items that are contained in the input map to this map.
-
public virtual bool
unset_all (
Map<K?,
V?> map)
Removes all items from this map that are common to the input map and this map.
-
public bool
remove_all (
Map<K?,
V?> map)
Removes all items from this map that are common to the input map and this map.
-
public virtual bool
has_all (
Map<K?,
V?> map)
Returns true it this map contains all items as the input map.
-
public bool
contains_all (
Map<K?,
V?> map)
Returns true it this map contains all items as the input map.
-
public
Iterator<
Entry<K?,
V?>> iterator ()
Returns a Iterator that can be used for
simple iteration over a collection.