Sharpility
Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue > Class Template Reference

Immutable implementation of CompositeDictionary. More...

Inheritance diagram for Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >:
Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >

List of all members.

Classes

class  ImmutableCompositeDictionaryBuilder
 Builder of CompositeDictionary. More...

Public Member Functions

void Put (TPrimaryKey primaryKey, TSecondaryKey secondaryKey, TValue value)
 Puts value by primary and secondary key.
void Put (CompositeKey< TPrimaryKey, TSecondaryKey > key, TValue value)
 Puts value by composite key.
void PutAll (CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue > compositeDictionary)
 Puts all values from composite dictionary.
void PutAll (IDictionary< TPrimaryKey, IDictionary< TSecondaryKey, TValue >> dictionary)
 Puts all values from dictionary.
void Clear ()
 Removes all entries.
bool Remove (TPrimaryKey primaryKey, TSecondaryKey secondaryKey)
 Removes value by primary and secondary key.
bool Remove (CompositeKey< TPrimaryKey, TSecondaryKey > key)
 Removes value by composite key.
ICollection< TValue > RemoveByPrimaryKey (TPrimaryKey primaryKey)
 Removes all values by primary key.
ICollection< TValue > RemoveBySecondaryKey (TSecondaryKey secondaryKey)
 Removes all values by secondary key.
TValue Get (CompositeKey< TPrimaryKey, TSecondaryKey > key)
 Returns value for composite key.
TValue Get (TPrimaryKey primaryKey, TSecondaryKey secondaryKey)
 Returns value for primary and secondary key.
ICollection< TValue > PrimaryKeyValues (TPrimaryKey primaryKey)
 Returns all values for primary key.
ICollection< TValue > SecondaryKeyValues (TSecondaryKey secondaryKey)
 Returns all values for secondary key.
ICollection< KeyValuePair
< TSecondaryKey, TValue > > 
PrimaryKeyEntries (TPrimaryKey primaryKey)
 Returns all entries for primary key.
ICollection< KeyValuePair
< TPrimaryKey, TValue > > 
SecondaryKeyEntries (TSecondaryKey secondaryKey)
 Returns all entries for secondary key.
bool ContainsKey (TPrimaryKey primaryKey, TSecondaryKey secondaryKey)
 Checks is dictionary contains primary and secondary key.
bool ContainsKey (CompositeKey< TPrimaryKey, TSecondaryKey > key)
 Checks is dictionary contains composite key.
bool ContainsValue (TValue value)
 Checks is dictionary contains value.
bool ContainsPrimaryKeyValue (TPrimaryKey primaryKey, TValue value)
 Checks is dictionary contains value mapped by primary key.
bool ContainsSecondaryKeyValue (TSecondaryKey secondaryKey, TValue value)
 Checks is dictionary contains value mapped by secondary key.
bool ContainsEntry (TPrimaryKey primaryKey, TSecondaryKey secondaryKey, TValue value)
 Checks is dictionary contains entry of primary-secondary-key, value.
bool ContainsEntry (CompositeKey< TPrimaryKey, TSecondaryKey > key, TValue value)
 Checks is dictionary contains entry.
IDictionary< TPrimaryKey,
IDictionary< TSecondaryKey,
TValue > > 
ToDictionary ()
 Converts CompositeDictionary to regular dictionary.
override bool Equals (object obj)
override int GetHashCode ()
override string ToString ()

Static Public Member Functions

static
ImmutableCompositeDictionaryBuilder
< TPrimaryKey, TSecondaryKey,
TValue > 
Builder ()
 Builder of ImmutableCompositeDictionary.

Properties

TValue this[CompositeKey< TPrimaryKey, TSecondaryKey > key] [get]
 Returns value for composite key.
ICollection< TValue > Values [get]
 Returns all values.
ISet< CompositeKey
< TPrimaryKey, TSecondaryKey > > 
Keys [get]
 Returns set of composite keys.
ISet< TPrimaryKey > PrimaryKeys [get]
 Retunrs set of primary keys.
ISet< TSecondaryKey > SecondaryKeys [get]
 Retunrs set of secondary keys.
int Count [get]
 Returns all values count.
int PrimaryKeysCount [get]
 Returns number of primary keys.
bool IsEmpty [get]
 Checks if dictionary is empty.
ICollection< KeyValuePair
< TPrimaryKey, KeyValuePair
< TSecondaryKey, TValue > > > 
Entries [get]
 Returns all entries.

Detailed Description

template<TPrimaryKey, TSecondaryKey, TValue>
class Sharpility::Collections::ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >

Immutable implementation of CompositeDictionary.

Template Parameters:
TPrimaryKeyType of primary key
TSecondaryKeyType of secondary key
TValueType of value

Member Function Documentation

template<TPrimaryKey , TSecondaryKey , TValue >
static ImmutableCompositeDictionaryBuilder<TPrimaryKey, TSecondaryKey, TValue> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Builder ( ) [inline, static]

Builder of ImmutableCompositeDictionary.

Returns:
template<TPrimaryKey , TSecondaryKey , TValue >
void Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Clear ( ) [inline]
template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ContainsEntry ( TPrimaryKey  primaryKey,
TSecondaryKey  secondaryKey,
TValue  value 
) [inline]

Checks is dictionary contains entry of primary-secondary-key, value.

Parameters:
primaryKeyPrimary key value
secondaryKeySecondary key value
valueChecked value
Returns:
true if given value is mapped by given primary and secondary key

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ContainsEntry ( CompositeKey< TPrimaryKey, TSecondaryKey >  key,
TValue  value 
) [inline]

Checks is dictionary contains entry.

Parameters:
keyEntry key
valueChecked value
Returns:
true if given value is mapped by given key

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ContainsKey ( TPrimaryKey  primaryKey,
TSecondaryKey  secondaryKey 
) [inline]

Checks is dictionary contains primary and secondary key.

Parameters:
primaryKeyPrimary key value
secondaryKeySecondary key value
Returns:
true if dictionary contains primary and secondary key

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ContainsKey ( CompositeKey< TPrimaryKey, TSecondaryKey >  key) [inline]

Checks is dictionary contains composite key.

Parameters:
keyComposite key value
Returns:
true if dictionary contains primary and secondary key

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ContainsPrimaryKeyValue ( TPrimaryKey  primaryKey,
TValue  value 
) [inline]

Checks is dictionary contains value mapped by primary key.

Parameters:
primaryKeyPrimary key value
valueChecked value
Returns:
true if dictionary contains value for given primary key

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ContainsSecondaryKeyValue ( TSecondaryKey  secondaryKey,
TValue  value 
) [inline]

Checks is dictionary contains value mapped by secondary key.

Parameters:
secondaryKeySecondary key value
valueChecked value
Returns:
true if dictionary contains value for given secondary key

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ContainsValue ( TValue  value) [inline]

Checks is dictionary contains value.

Parameters:
valueChecked value
Returns:
true if dictionary contains given value

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
TValue Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Get ( CompositeKey< TPrimaryKey, TSecondaryKey >  key) [inline]

Returns value for composite key.

Parameters:
keyComposite key of primary and secondary key
Returns:
Value

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
TValue Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Get ( TPrimaryKey  primaryKey,
TSecondaryKey  secondaryKey 
) [inline]

Returns value for primary and secondary key.

Parameters:
primaryKeyPrimary key value
secondaryKeySecondary key value
Returns:
Value

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<KeyValuePair<TSecondaryKey, TValue> > Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.PrimaryKeyEntries ( TPrimaryKey  primaryKey) [inline]

Returns all entries for primary key.

Parameters:
primaryKeyPrimary key value
Returns:
Primary key entries

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<TValue> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.PrimaryKeyValues ( TPrimaryKey  primaryKey) [inline]

Returns all values for primary key.

Parameters:
primaryKeyPrimary key
Returns:
Values

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
void Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Put ( TPrimaryKey  primaryKey,
TSecondaryKey  secondaryKey,
TValue  value 
) [inline]

Puts value by primary and secondary key.

Parameters:
primaryKeyPrimary key value
secondaryKeySecondary key value
valueValue

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
void Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Put ( CompositeKey< TPrimaryKey, TSecondaryKey >  key,
TValue  value 
) [inline]

Puts value by composite key.

Parameters:
keyComposite key of primary and secondary key
valueValue

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
void Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.PutAll ( CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >  compositeDictionary) [inline]

Puts all values from composite dictionary.

Parameters:
compositeDictionaryCompositeDictionary

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
void Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.PutAll ( IDictionary< TPrimaryKey, IDictionary< TSecondaryKey, TValue >>  dictionary) [inline]

Puts all values from dictionary.

Parameters:
dictionaryDictionary

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Remove ( TPrimaryKey  primaryKey,
TSecondaryKey  secondaryKey 
) [inline]

Removes value by primary and secondary key.

Parameters:
primaryKeyPrimary key value
secondaryKeySecondary key value
Returns:
true if value was removed

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Remove ( CompositeKey< TPrimaryKey, TSecondaryKey >  key) [inline]

Removes value by composite key.

Parameters:
keyComposite key of primary and secondary key
Returns:
true if value was removed

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<TValue> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.RemoveByPrimaryKey ( TPrimaryKey  primaryKey) [inline]

Removes all values by primary key.

Parameters:
primaryKeyPrimary key value
Returns:
Removed values

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<TValue> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.RemoveBySecondaryKey ( TSecondaryKey  secondaryKey) [inline]

Removes all values by secondary key.

Parameters:
secondaryKeySecondary key value
Returns:
Removed values

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<KeyValuePair<TPrimaryKey, TValue> > Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.SecondaryKeyEntries ( TSecondaryKey  secondaryKey) [inline]

Returns all entries for secondary key.

Parameters:
secondaryKeySecondary key value
Returns:
Secondary key entries

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<TValue> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.SecondaryKeyValues ( TSecondaryKey  secondaryKey) [inline]

Returns all values for secondary key.

Parameters:
secondaryKeySecondary key
Returns:
Values

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
IDictionary<TPrimaryKey, IDictionary<TSecondaryKey, TValue> > Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.ToDictionary ( ) [inline]

Converts CompositeDictionary to regular dictionary.

Returns:
dictionary

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.


Property Documentation

template<TPrimaryKey , TSecondaryKey , TValue >
int Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Count [get]
template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<KeyValuePair<TPrimaryKey, KeyValuePair<TSecondaryKey, TValue> > > Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Entries [get]
template<TPrimaryKey , TSecondaryKey , TValue >
bool Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.IsEmpty [get]
template<TPrimaryKey , TSecondaryKey , TValue >
ISet<CompositeKey<TPrimaryKey, TSecondaryKey> > Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Keys [get]
template<TPrimaryKey , TSecondaryKey , TValue >
ISet<TPrimaryKey> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.PrimaryKeys [get]
template<TPrimaryKey , TSecondaryKey , TValue >
int Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.PrimaryKeysCount [get]
template<TPrimaryKey , TSecondaryKey , TValue >
ISet<TSecondaryKey> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.SecondaryKeys [get]
template<TPrimaryKey , TSecondaryKey , TValue >
TValue Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.this[CompositeKey< TPrimaryKey, TSecondaryKey > key] [get]

Returns value for composite key.

Parameters:
keyComposite key of primary and secondary key
Returns:
Value

Implements Sharpility.Collections.CompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.

template<TPrimaryKey , TSecondaryKey , TValue >
ICollection<TValue> Sharpility.Collections.ImmutableCompositeDictionary< TPrimaryKey, TSecondaryKey, TValue >.Values [get]

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