Go to the documentation of this file.
18 #ifndef __LIBSTD_ASSOCIATIVE_H
19 #define __LIBSTD_ASSOCIATIVE_H
53 virtual bool insert(
const K & key,
const V & item)
66 virtual bool append(
const K & key,
const V & item)
113 return values(key).count() > 0;
137 virtual const V *
get(
const K & key)
const = 0;
148 virtual const V &
at(
const K & key)
const = 0;
160 virtual const V
value(
const K & key,
const V defaultValue = V())
const = 0;
177 return a.
size() - sz;
180 if (a.
count() != cnt)
181 return a.
count() - cnt;
virtual int remove(const K &key)
Removes all items associated with the given key.
virtual Size count() const =0
Returns the number of items inside the Container.
Containers provide access to stored items.
virtual List< V > values() const =0
Retrieve all values inside the Association.
virtual bool append(const K &key, const V &item)
Append the given item to the Association.
Objects which can be compared to each other.
virtual bool insert(const K &key, const V &item)
Inserts the given item to the Assocation.
virtual void clear()
Removes all items from the Association.
virtual int compareTo(const Associative< K, V > &a) const
Compare this instance to another instance.
virtual bool equals(const Associative< K, V > &a) const
Test if an Associative is equal to an other Associative.
virtual bool contains(const K &key) const
Check if the given key exists.
virtual bool hasCurrent() const
Check if there is a current item on the List.
virtual List< K > keys() const =0
Retrieve all keys inside the Association.
unsigned int Size
Any sane size indicator cannot go negative.
virtual const V value(const K &key, const V defaultValue=V()) const =0
Return the first value for the given key.
virtual bool hasNext() const
Check if there is more on the List to iterate.
virtual const V * get(const K &key) const =0
Returns the first value for the given key.
Associatives are containers that provide a mapping of keys to values.
const V & operator[](K key) const
Returns the first value for the given key.
virtual bool contains(const T t) const
Check whether an element is on the List.
virtual const V & at(const K &key) const =0
Returns a reference to the first value for the given key.
virtual Size size() const =0
Returns the maximum size of this Container.