Class ConverterCollections.ConverterDictionary
A Converter Dictionary views an underlying IDictionary through a set of key and value IConverters.
Inherited Members
Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
[Serializable]
public class ConverterCollections.ConverterDictionary : IDictionary, ICollection, IEnumerable
Constructors
ConverterDictionary(IDictionary, IConverter, IConverter, IConverter, IConverter)
Constructor.
Declaration
public ConverterDictionary(IDictionary dict, IConverter convKeyUp, IConverter convKeyDown, IConverter convValUp, IConverter convValDown)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary | dict | The underlying IDictionary. |
| IConverter | convKeyUp | The IConverter to view the underlying dictinary's keys through. |
| IConverter | convKeyDown | The IConverter to use to pass keys down to the underlying dictionary. |
| IConverter | convValUp | The IConverter to view the underlying dictionary's values through. |
| IConverter | convValDown | The IConverter to use to pass values down to the underlying dictionary. |
Fields
m_convKeyDown
The IConverter used to pass keys down to the dictionary.
Declaration
protected IConverter m_convKeyDown
Field Value
| Type | Description |
|---|---|
| IConverter |
m_convKeyUp
The IConverter used to view keys stored in the dictionary.
Declaration
protected IConverter m_convKeyUp
Field Value
| Type | Description |
|---|---|
| IConverter |
m_convValDown
The IConverter used to pass keys down to the dictionary.
Declaration
protected IConverter m_convValDown
Field Value
| Type | Description |
|---|---|
| IConverter |
m_convValUp
The IConverter used to view values stored in the dictionary.
Declaration
protected IConverter m_convValUp
Field Value
| Type | Description |
|---|---|
| IConverter |
m_dictionary
The underlying dictionary.
Declaration
protected IDictionary m_dictionary
Field Value
| Type | Description |
|---|---|
| IDictionary |
Properties
ConverterKeyDown
The IConverter used to pass keys down to the underlying dictionary.
Declaration
public virtual IConverter ConverterKeyDown { get; }
Property Value
| Type | Description |
|---|---|
| IConverter | The IConverter to the underlying dictionary's keys. |
ConverterKeyUp
The IConverter used to view the underlying dictionary's keys through.
Declaration
public virtual IConverter ConverterKeyUp { get; }
Property Value
| Type | Description |
|---|---|
| IConverter | The IConverter from the underlying dictionary's keys. |
ConverterValueDown
The IConverter used to pass values down to the underlying dictionary.
Declaration
public virtual IConverter ConverterValueDown { get; }
Property Value
| Type | Description |
|---|---|
| IConverter | The IConverter to the underlying dictionary's values. |
ConverterValueUp
The IConverter used to view the underlying dictionary's values through.
Declaration
public virtual IConverter ConverterValueUp { get; }
Property Value
| Type | Description |
|---|---|
| IConverter | The IConverter from the underlying dictionary's values. |
Count
Gets the number of elements contained in the dictionary.
Declaration
public virtual int Count { get; }
Property Value
| Type | Description |
|---|---|
| int | The number of elements contained in the dictionary. |
Dictionary
The underlying IDictionary.
Declaration
public virtual IDictionary Dictionary { get; }
Property Value
| Type | Description |
|---|---|
| IDictionary | The underlying IDictionary. |
IsFixedSize
Gets a value indicating whether the dictionary has a fixed size.
Declaration
public virtual bool IsFixedSize { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if the dictionary has a fixed size; otherwise, false. |
IsReadOnly
Gets a value indicating whether the dictionary is read-only.
Declaration
public virtual bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if the dictionary is read-only; otherwise, false. |
IsSynchronized
Gets a value indicating whether access to the dictionary is synchronized (thread safe).
Declaration
public virtual bool IsSynchronized { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if access to the dictionary is synchronized (thread safe); otherwise, false. |
this[object]
Gets or sets the element with the specified key.
Declaration
public virtual object this[object key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| object | key | The key of the element to get or set. |
Property Value
| Type | Description |
|---|---|
| object | The element with the specified key. |
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | The property is set and the dictionary object is read-only or the property is set, key does not exist in the collection, and the dictionary has a fixed size. |
| ArgumentNullException | Key is |
Keys
Gets an ICollection containing the keys of the dictionary.
Declaration
public virtual ICollection Keys { get; }
Property Value
| Type | Description |
|---|---|
| ICollection | An ICollection containing the keys of the dictionary. |
SyncRoot
Gets an object that can be used to synchronize access to the dictionary.
Declaration
public virtual object SyncRoot { get; }
Property Value
| Type | Description |
|---|---|
| object | An object that can be used to synchronize access to the dictionary. |
Values
Gets an ICollection containing the values in the dictionary.
Declaration
public virtual ICollection Values { get; }
Property Value
| Type | Description |
|---|---|
| ICollection | An ICollection containing the values in the dictionary. |
Methods
Add(object, object)
Adds an element with the provided key and value to the dictionary.
Declaration
public virtual void Add(object key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | key | The object to use as the key of the element to add. |
| object | value | The object to use as the value of the element to add. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | An element with the same key already exists in the dictionary. |
| ArgumentNullException | Key is |
| NotSupportedException | The dictionary is read-only or the dictionary has a fixed size. |
Clear()
Removes all elements from the dictionary.
Declaration
public virtual void Clear()
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | The dictionary is read-only. |
Contains(object)
Determines whether the dictionary contains an element with the specified key.
Declaration
public virtual bool Contains(object key)
Parameters
| Type | Name | Description |
|---|---|---|
| object | key | The key to locate in the dictionary. |
Returns
| Type | Description |
|---|---|
| bool | true if the dictionary contains an element with the key; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Key is |
CopyTo(Array, int)
Copies the elements of the collection to an array, starting at a particular index.
Declaration
public virtual void CopyTo(Array array, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Array | array | The one-dimensional array that is the destination of the elements copied from collection. The array must have zero-based indexing. |
| int | index | The zero-based index in array at which copying begins. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Array is null. |
| ArgumentOutOfRangeException | Index is less than zero. |
| ArgumentException | Array is multidimensional or index is equal to or greater than the length of array or the number of elements in the source collection is greater than the available space from index to the end of the destination array. |
| InvalidCastException | The type of the source collection cannot be cast automatically to the type of the destination array. |
GetEnumerator()
Returns an IDictionaryEnumerator object for the dictionary.
Declaration
public virtual IDictionaryEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| IDictionaryEnumerator | An IDictionaryEnumerator for the dictionary. |
InstantiateCollection(ICollection, IConverter, IConverter)
Create a Converter Collection.
Declaration
protected virtual ICollection InstantiateCollection(ICollection col, IConverter convUp, IConverter convDown)
Parameters
| Type | Name | Description |
|---|---|---|
| ICollection | col | The underlying collection. |
| IConverter | convUp | The IConverter to view the underlying collection through. |
| IConverter | convDown | The IConverter to pass items down to the underlying collection through. |
Returns
| Type | Description |
|---|---|
| ICollection |
InstantiateDictionary(IDictionary, IConverter, IConverter, IConverter, IConverter)
Create a Converter Dictionary.
Declaration
protected virtual IDictionary InstantiateDictionary(IDictionary dict, IConverter convKeyUp, IConverter convKeyDown, IConverter convValUp, IConverter convValDown)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary | dict | The underlying IDictionary. |
| IConverter | convKeyUp | The IConverter to view the underlying dictionary's keys through. |
| IConverter | convKeyDown | The IConverter to use to pass keys down to the underlying dictionary. |
| IConverter | convValUp | The IConverter to view the underlying dictionary's values through. |
| IConverter | convValDown | The IConverter to use to pass values down to the underlying dictionary. |
Returns
| Type | Description |
|---|---|
| IDictionary |
InstantiateDictionaryEnumerator(IDictionaryEnumerator, IConverter, IConverter)
Returns an instance of IDictionaryEnumerator that uses an IConverters to view an underlying enumerator.
Declaration
protected virtual IDictionaryEnumerator InstantiateDictionaryEnumerator(IDictionaryEnumerator enumerator, IConverter convKey, IConverter convVal)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionaryEnumerator | enumerator | The underlying IDictionaryEnumerator. |
| IConverter | convKey | The IConverter to view the underlying IDictionaryEnumerator keys through. |
| IConverter | convVal | The IConverter to view the underlying IDictionaryEnumerator values through. |
Returns
| Type | Description |
|---|---|
| IDictionaryEnumerator | An IDictionaryEnumerator that views the passed enumerator through the specified IConverters. |
Remove(object)
Removes the element with the specified key from the dictionary.
Declaration
public virtual void Remove(object key)
Parameters
| Type | Name | Description |
|---|---|---|
| object | key | The key of the element to remove. |
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | The dictionary is read-only or the dictionary has a fixed size. |
| ArgumentNullException | Key is |
ToString()
Return a string description for this dictionary.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string description of the dictionary. |