Sharpility
Sharpility.Collections.AbstractMultiDictionary< TKey, TValue > Class Template Reference

Abstraction of MultiDictionary. More...

Inheritance diagram for Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >:
Sharpility.Collections.MultiDictionary< TKey, TValue > Sharpility.Collections.ArrayListMultiDictionary< TKey, TValue > Sharpility.Collections.HashSetMultiDictionary< TKey, TValue > Sharpility.Collections.LinkedListMultiDictionary< TKey, TValue >

List of all members.

Public Member Functions

void Put (TKey key, TValue value)
 Puts value at given key.
void PutAll (TKey key, IEnumerable< TValue > values)
 Puts multiple values to given key.
void PutAll (MultiDictionary< TKey, TValue > multiDictionary)
 Pults all entries from given multiDictionary.
void PutAll (IEnumerable< KeyValuePair< TKey, TValue >> entries)
 Puts all entries.
bool Remove (TKey key)
 Removes key entries.
bool Remove (TKey key, TValue value)
 Removes key-value entry.
ICollection< TValue > RemoveAll (TKey key)
 Removes all values at given key.
ICollection< TValue > ReplaceValues (TKey key, IEnumerable< TValue > values)
 Replaces all values by given key.
void Clear ()
 Removes all entries.
ICollection< TValue > Get (TKey key)
 Returns all values mapped by given key.
bool ContainsKey (TKey key)
 Checks is dictionary contains given key.
int ValuesCount (TKey key)
 Returns number of all values stored by given key.
bool ContainsValue (TValue value)
 Checks is dictionary contains given value.
bool ContainsEntry (TKey key, TValue value)
 Checks is dictionary contains given entry.
IDictionary< TKey, ICollection
< TValue > > 
ToDictionary ()
 Converts multi dictionary to regular dictionary.
override bool Equals (object obj)
override int GetHashCode ()
override string ToString ()

Protected Member Functions

abstract ICollection< TValue > CreateCollection (int capacity)
 Creates collection matching MultiDictionary implementation with given capacity.
abstract ICollection< TValue > ResultCollection (ICollection< TValue > collection)
 Creates collection matching MultiDictionary implementation.
abstract ICollection< TValue > ComparableCollection (ICollection< TValue > collection)
 Created comparable collection from given collection.

Properties

int Count [get, set]
 Returns number of all values.
ICollection< TValue > this[TKey key] [get]
 Returns all values mapped by given key.
ISet< TKey > Keys [get]
 Returns set of all keys.
ICollection< TValue > Values [get]
 Returns all values.
ICollection< KeyValuePair
< TKey, TValue > > 
Entries [get]
 Returns all entries.
ICollection< KeyValuePair
< TKey, ICollection< TValue > > > 
MultiEntries [get]
 Returns entries with multiple values for given key.
bool IsEmpty [get]
 Checks is dictionary is emtpy.

Detailed Description

template<TKey, TValue>
class Sharpility::Collections::AbstractMultiDictionary< TKey, TValue >

Abstraction of MultiDictionary.

Template Parameters:
TKeyType of key
TValueType of value

Member Function Documentation

template<TKey , TValue >
void Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Clear ( ) [inline]
template<TKey , TValue >
abstract ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ComparableCollection ( ICollection< TValue >  collection) [protected, pure virtual]

Created comparable collection from given collection.

Parameters:
collectiontransformed collection
Returns:
comparable collection

Implemented in Sharpility.Collections.ArrayListMultiDictionary< TKey, TValue >, Sharpility.Collections.LinkedListMultiDictionary< TKey, TValue >, and Sharpility.Collections.HashSetMultiDictionary< TKey, TValue >.

template<TKey , TValue >
bool Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ContainsEntry ( TKey  key,
TValue  value 
) [inline]

Checks is dictionary contains given entry.

Parameters:
keyChecked key
valueChecked value
Returns:
true if entry is stored in dictionary

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
bool Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ContainsKey ( TKey  key) [inline]

Checks is dictionary contains given key.

Parameters:
keyChecked key
Returns:
true if any value is stored by given key

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
bool Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ContainsValue ( TValue  value) [inline]

Checks is dictionary contains given value.

Parameters:
valueChecked value
Returns:
true if value is stored in dictionary

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
abstract ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.CreateCollection ( int  capacity) [protected, pure virtual]

Creates collection matching MultiDictionary implementation with given capacity.

Parameters:
capacitycollection capacity
Returns:
created collection

Implemented in Sharpility.Collections.ArrayListMultiDictionary< TKey, TValue >, Sharpility.Collections.LinkedListMultiDictionary< TKey, TValue >, and Sharpility.Collections.HashSetMultiDictionary< TKey, TValue >.

template<TKey , TValue >
ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Get ( TKey  key) [inline]

Returns all values mapped by given key.

Parameters:
keyKey
Returns:
Values for given key

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
void Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Put ( TKey  key,
TValue  value 
) [inline]

Puts value at given key.

Parameters:
keykey value
valuevalue

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
void Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.PutAll ( TKey  key,
IEnumerable< TValue >  values 
) [inline]

Puts multiple values to given key.

Parameters:
key
values

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
void Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.PutAll ( MultiDictionary< TKey, TValue >  multiDictionary) [inline]

Pults all entries from given multiDictionary.

Parameters:
multiDictionaryMultiDictionary

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
void Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.PutAll ( IEnumerable< KeyValuePair< TKey, TValue >>  entries) [inline]

Puts all entries.

Parameters:
entriesKeyValuePair entries

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
bool Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Remove ( TKey  key) [inline]

Removes key entries.

Parameters:
keyRemoved key
Returns:
true - if any value was removed

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
bool Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Remove ( TKey  key,
TValue  value 
) [inline]

Removes key-value entry.

Parameters:
keyRemoved key
valueRemoved value
Returns:
true if entry was removed

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.RemoveAll ( TKey  key) [inline]

Removes all values at given key.

Parameters:
keyRemoved keyh
Returns:
Removed values

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ReplaceValues ( TKey  key,
IEnumerable< TValue >  values 
) [inline]

Replaces all values by given key.

Parameters:
keyKey value
valuesValues to replace
Returns:
Replaced values

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
abstract ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ResultCollection ( ICollection< TValue >  collection) [protected, pure virtual]
template<TKey , TValue >
IDictionary<TKey, ICollection<TValue> > Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ToDictionary ( ) [inline]

Converts multi dictionary to regular dictionary.

Returns:

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
int Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.ValuesCount ( TKey  key) [inline]

Returns number of all values stored by given key.

Parameters:
keyKey
Returns:
Number of all values stored by given key

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.


Property Documentation

template<TKey , TValue >
int Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Count [get, set]

Returns number of all values.

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
ICollection<KeyValuePair<TKey, TValue> > Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Entries [get]
template<TKey , TValue >
bool Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.IsEmpty [get]

Checks is dictionary is emtpy.

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
ISet<TKey> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Keys [get]

Returns set of all keys.

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
ICollection<KeyValuePair<TKey, ICollection<TValue> > > Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.MultiEntries [get]

Returns entries with multiple values for given key.

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.this[TKey key] [get]

Returns all values mapped by given key.

Parameters:
keyKey
Returns:
Values for given key

Implements Sharpility.Collections.MultiDictionary< TKey, TValue >.

template<TKey , TValue >
ICollection<TValue> Sharpility.Collections.AbstractMultiDictionary< TKey, TValue >.Values [get]

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Enumerations Properties