Click or drag to resize

HashDictionary Class

Oracle® Fusion Middleware .NET API Reference for Oracle Coherence
14c (14.1.1.0)
F23534-02
Hashtable-based IDictionary implementation that allows null keys.
Inheritance Hierarchy
SystemObject
  System.CollectionsHashtable
    Tangosol.Util.CollectionsHashDictionary

Namespace:  Tangosol.Util.Collections
Assembly:  Coherence (in Coherence.dll) Version: 14.1.1.14 (14.1.1.14)
Syntax
C#
[SerializableAttribute]
public class HashDictionary : Hashtable, 
	IEnumerable

The HashDictionary type exposes the following members.

Constructors
  NameDescription
Public methodHashDictionary
Initializes a new instance of the HashDictionary class using the default initial capacity, load factor, hash code provider, and comparer.
Public methodHashDictionary(IDictionary)
Initializes a new instance of the HashDictionary class by copying the elements from the specified dictionary to the new HashDictionary object. The new HashDictionary object has an initial capacity equal to the number of elements copied, and uses the default load factor, hash code provider, and comparer.
Public methodHashDictionary(IEqualityComparer)
Initializes a new instance of the HashDictionary class using the default initial capacity and load factor, and the specified IEqualityComparer object.
Public methodHashDictionary(Int32)
Initializes a new instance of the HashDictionary class using the specified initial capacity, and the default load factor, hash code provider, and comparer.
Public methodHashDictionary(IDictionary, IEqualityComparer)
Initializes a new instance of the HashDictionary class by copying the elements from the specified dictionary to the new HashDictionary object. The new HashDictionary object has an initial capacity equal to the number of elements copied, and uses the default load factor and the specified IEqualityComparer object.
Public methodHashDictionary(IDictionary, Single)
Initializes a new instance of the HashDictionary class by copying the elements from the specified dictionary to the new HashDictionary object. The new HashDictionary object has an initial capacity equal to the number of elements copied, and uses the specified load factor, and the default hash code provider and comparer.
Public methodHashDictionary(Int32, IEqualityComparer)
Initializes a new instance of the HashDictionary class using the specified initial capacity and IEqualityComparer, and the default load factor.
Public methodHashDictionary(Int32, Single)
Initializes a new instance of the HashDictionary class using the specified initial capacity and load factor, and the default hash code provider and comparer.
Protected methodHashDictionary(SerializationInfo, StreamingContext)
Initializes a new instance of the HashDictionary class that is serializable using the specified SerializationInfo and StreamingContext objects.
Public methodHashDictionary(IDictionary, Single, IEqualityComparer)
Initializes a new instance of the HashDictionary class by copying the elements from the specified dictionary to the new HashDictionary object. The new HashDictionary object has an initial capacity equal to the number of elements copied, and uses the specified load factor and IEqualityComparer object.
Public methodHashDictionary(Int32, Single, IEqualityComparer)
Initializes a new instance of the HashDictionary class using the specified initial capacity, load factor, and IEqualityComparer object.
Top
Properties
  NameDescription
Protected propertycomparer Obsolete.
Gets or sets the IComparer to use for the Hashtable.
(Inherited from Hashtable.)
Public propertyCount
Gets the number of elements contained in the ICollection.
(Overrides HashtableCount.)
Protected propertyEqualityComparer (Inherited from Hashtable.)
Protected propertyhcp Obsolete.
Gets or sets the object that can dispense hash codes.
(Inherited from Hashtable.)
Public propertyIsFixedSize (Inherited from Hashtable.)
Protected propertyIsNullValueSet
Returns true is the value for the null key is set, false otherwise.
Public propertyIsReadOnly (Inherited from Hashtable.)
Public propertyIsSynchronized (Inherited from Hashtable.)
Public propertyItem
Gets or sets the element with the specified key.
(Overrides HashtableItemObject.)
Public propertyKeys
Gets an ICollection object containing the keys of this dictionary.
(Overrides HashtableKeys.)
Public propertySyncRoot (Inherited from Hashtable.)
Public propertyValues
Gets an ICollection object containing the values in this dictionary.
(Overrides HashtableValues.)
Top
Methods
  NameDescription
Public methodAdd
Adds an element with the provided key and value to the IDictionary object.
(Overrides HashtableAdd(Object, Object).)
Protected methodAssertIsVariableSize
Throw an exception if this dictionary is fixed size.
Protected methodAssertIsWriteable
Throw an exception if this dictionary is read-only.
Public methodClear
Removes all elements from the IDictionary object.
(Overrides HashtableClear.)
Public methodClone
Creates a new object that is a copy of the current instance.
(Overrides HashtableClone.)
Public methodContains
Determines whether this dictionary contains an entry with the specified key.
(Overrides HashtableContains(Object).)
Public methodContainsKey
Determines whether the HashDictionary contains a specific key.
(Overrides HashtableContainsKey(Object).)
Public methodContainsValue
Determines whether the HashDictionary contains a specific value.
(Overrides HashtableContainsValue(Object).)
Public methodCopyTo
Copies the elements of the collection to an array, starting at a particular array index.
(Overrides HashtableCopyTo(Array, Int32).)
Public methodEquals(IDictionary)
Compares this dictionary with another dictionary for equality.
Public methodEquals(Object)
Determines whether the specified object is equal to this object.
(Overrides ObjectEquals(Object).)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator
Returns an IDictionaryEnumerator object for this dictionary.
(Overrides HashtableGetEnumerator.)
Protected methodGetHash (Inherited from Hashtable.)
Public methodGetHashCode
Returns a hash code for this object.
(Overrides ObjectGetHashCode.)
Public methodGetObjectData
Overrides serialization method to add support for null value serialization.
(Overrides HashtableGetObjectData(SerializationInfo, StreamingContext).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodKeyEquals (Inherited from Hashtable.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOnDeserialization
Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
(Inherited from Hashtable.)
Public methodRemove
Removes the element with the specified key from the IDictionary object.
(Overrides HashtableRemove(Object).)
Public methodToString
Returns string representation of this instance.
(Overrides ObjectToString.)
Top
Remarks
Note that null keys support intentionally breaks the IDictionary contract, which states that an ArgumentNullException should be raised if the key is null.

However, this is necessary in order to match the behavior in Java and C++, where some Map implementations support null keys.

Note: This implementation is not thread safe. If you need it to be, you should wrap it with the SynchronizedDictionary.

See Also