BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 This class is safe for multiple readers and a single writer. System.Object System.Collections.IDictionary System.ICloneable System.Runtime.Serialization.IDeserializationCallback System.Runtime.Serialization.ISerializable System.Runtime.InteropServices.ComVisible(true)

Represents a hash table.

A represents a dictionary with a constant lookup time that contains entries of associated keys and values. The type of each entry in a is . A statement that exposes each element in the collection is required to iterate over this type. See example.

Objects used as keys in a are required to either implement both and or neither. Furthermore, for a particular key, these methods are required to produce the same results when called with the same parameters while that key exists in a particular . Keys cannot be mutated while they are used in the table.

Every key in a is required to be unique compared to every other key in the table. An object that implements can determine whether two keys are unequal. The default comparer for a key is the key's implementation of .

Each value in a is required to provide its own hash function, which can be accessed by calling . Alternatively, if an object that implements is passed to a constructor, the custom hash function provided by that object is used for every value in the table.

The default capacity (i.e. the default number of entries that can be contained) of a is zero.

When an entry is added to the , the entry is placed into a bucket based on the hash code obtained from the implementation of the table, or the if no specific was provided. Subsequent lookups of the key use the hash code of the key to search in only one particular bucket, substantially reducing the number of key comparisons required to find an entry.

As entries are added to a , and the maximum capacity of the table is reached, the number of buckets in the table is automatically increased to the smallest prime number that is larger than twice the current number of buckets.

A can safely support one writer and multiple readers concurrently. To support multiple writers, all operations are required to be done through the wrapper returned by the method.

The following example shows how to iterate over the elements of a .

[C#]

foreach (DictionaryEntry myEntry in myHashtable)

- Constructor

  Constructs and initializes a new instance of the class.

  The new instance is initialized with the default capacity, , and .

  0
  1.0.5000.0
  2.0.0.0
- Constructor
  The used to initialize the elements of the new instance.

  Constructs and initializes a new instance of the class using the values of the specified .

  The initial capacity of the new instance is set to the number of entries in . The new instance is initialized with the default and .

  is .
  0
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  2.0.0.0
- Constructor
  A that specifies the minimum number of entries that the new instance can initially contain.

  Constructs and initializes a new instance of the class with the specified initial capacity.

  The new instance is initialized with the default and .

  The number of entries that the new instance can contain can be greater than .

  < 0.
  0
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
- Constructor

  The that supplies the hash codes for all keys in the ; or, to use the default hash code provider.

  The to use to determine whether two keys are equal; or, to use the default comparer.

  Constructs and initializes a new instance of the class with the specified and the specified .

  The new instance is initialized with the default capacity.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("Please use Hashtable(IEqualityComparer) instead")
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
- Constructor
  The used to initialize the elements of the new instance.

  The that supplies the hash codes for all keys in the new instance; or, to use the default hash code provider.

  The to use to determine whether two keys are equal in the new instance, or to use the default comparer.

  Constructs and initializes a new instance of the class using the values of the specified , the specified , and the specified .

  The initial capacity of the new instance is set to the number of entries in .

  is .
  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("Please use Hashtable(IDictionary, IEqualityComparer) instead")
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  2.0.0.0
- Constructor
  A that specifies the minimum number of entries that the new instance can initially contain.

  The that supplies the hash codes for all keys in the ; or, to use the default hash code provider.

  The to use to determine whether two keys are equal, or to use the default comparer.

  Constructs and initializes a new instance of the class with the specified initial capacity, the specified , and the specified .

  To be added.
  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("Please use Hashtable(int, IEqualityComparer) instead")
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  2.0.0.0
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
  System.Obsolete("Please use Hashtable(IDictionary, float, IEqualityComparer) instead")
- Constructor
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
  1.0.5000.0
  2.0.0.0
  System.Obsolete("Please use Hashtable(int, float, IEqualityComparer) instead")
- Method
  System.Void `` `` The key of the entry to add. The value of the entry to add.

  Adds an entry with the specified key and value into the current instance.

  To be added.

  is .

  An entry with the same key already exists in the current instance.

  The current instance is read-only or has a fixed size.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  Removes all entries from the current instance.

  This method is implemented to support the interface.

  As described above.

  The value of each key and value in the current instance is set to . The property of the current instance is set to zero. The capacity of the current instance remains unchanged.

  If the current instance is empty, it remains unchanged and no exception is thrown.

  The current instance is read-only. 0 1.0.5000.0 2.0.0.0 System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
- Method
  System.Object

  Creates a that is a copy of the current instance.

  A that is a copy of the current instance.

  This method is implemented to support the interface.

  As described above.

  This method creates a new instance is initialized with the same count, implementation, and implementation as the current instance. The references to the objects contained by the current instance are copied to the new instance.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Collections.IComparer To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 System.Obsolete("Please use EqualityComparer property.")
- Method
  System.Boolean `` The key to locate in the current instance.

  Determines whether the current instance contains the specified key.

  if the current instance contains ; otherwise, .

  This method is implemented to support the interface.

  As described above.

  This method is equivalent to .

  For the default implementation, this method has a constant (O(1)) lookup time.

  is . 0 1.0.5000.0 2.0.0.0
- Method
  System.Boolean `` The key of the entry to locate in the current instance.

  Determines whether the current instance contains an entry with the specified key.

  if the current instance contains an entry with ; otherwise, .

  As described above.

  This method uses to compare to the keys in the current instance.

  For the default implementation, this method has a constant (O(1)) lookup time.

  is . 0 1.0.5000.0 2.0.0.0
- Method
  System.Boolean `` The value to locate in the current instance.

  Determines whether the current instance contains an entry with the specified value.

  if the current instance contains an entry with ; otherwise, .

  This method is implemented to support the interface.

  As described above.

  This method is equivalent to .

  For the default implementation, this method has a constant (O(1)) lookup time.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Void `` `` The one-dimensional, zero-indexed that is the destination of the objects copied from the current instance. A that specifies the zero-based index in at which copying begins. This value is between 0 and .Length minus the of the current instance, inclusive.

  Copies the entries of the current instance to a one-dimensional starting at the specified index.

  As described above.

  The elements in the current instance are copied to the in the same order in which they are contained the current instance. If is not assignment-compatible with the type of , a is thrown. If an exception is thrown while copying, the state of the current instance is undefined.

  is . < 0.

  has more than one dimension.

  -or-

  > .Length - The of the current instance.

  The type of the current instance is not assignment-compatible with the type of . 0 1.0.5000.0 2.0.0.0
- Property
  System.Int32

  Gets the number of key-and-value pairs contained in the current instance.

  A that specifies the number of key-and-value pairs contained in the current instance.

  This property is read-only.

  As described above.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Collections.IEqualityComparer To be added. To be added. To be added. 2.0.0.0
- Method
  System.Collections.IDictionaryEnumerator

  Returns a for the current instance.

  A for the current instance.

  If the current instance is modified while an enumeration is in progress, a call to or throws .

  For detailed information regarding the use of an enumerator, see .

  This property is implemented to support the interface.

  As described above.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Int32 `` The whose hash code is to be generated.

  Generates a hash code for the specified key in the current instance.

  A containing the hash code for .

  This method is accessible only through this class or a derived class.

  As described above.

  If the current instance was instantiated with a specific implementation, this method uses that hash code provider; otherwise, it uses the implementation of .

  is . 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Property
  System.Collections.IHashCodeProvider To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 System.Obsolete("Please use EqualityComparer property.")
- Property
  System.Boolean Implemented to support the interface. [Note: For more information, see .]

  if the current instance has a fixed size; otherwise, .

  This property is read-only.

  Elements can be modified in, but not added to or removed from a with a fixed size.

  As described above.

  The default value of this property is .

  Override this property, setting it to , to prevent addition or removal of entries in the current instance.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean Implemented to support the interface. [Note: For more information, see .]

  if the current instance is read-only; otherwise, .

  This property is read-only.

  Elements cannot be modified in, added to, or removed from a that is read-only.

  As described above.

  The default value of this property is .

  Override this property, setting it to , in order to prevent the addition, removal, or modification of entries in the current instance.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean Implemented to support the interface. [Note: For more information, see .]

  if access to the current instance is synchronized (thread-safe); otherwise, .

  This property is read-only.

  This property is implemented to support the interface.

  For more information regarding synchronization of access to a , see .

  As described above.

  The default value of this property is .

  Override this property, setting it to , if thread-safety can be guaranteed for the current instance. In order to obtain this safety, use or .

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Object `` The key whose value to get or set.

  Gets or sets the value in the current instance that is associated with the specified key.

  The value in the current instance that is associated with . If is not contained in the current instance, attempting to get it returns , and attempting to set it creates a new entry using

  .

  This property provides the ability to access a specific element in the current instance using the following notation: myCollection[key] .

  As described above.

  If this property is being set and is already contained in the current instance, the value associated with the old key is replaced.

  is .

  The property is being set and the current instance is read-only.

  The property is being set, is not contained in the current instance, and the current instance has a fixed size.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Boolean `` `` The to compare with . The key in the current instance to compare with .

  Determines whether the specified and the specified key in the current instance represent the same value.

  if and represent the same value; otherwise, .

  This method is accessible only through this class or a derived class.

  As described above.

  If the current instance was initialized with a specified implementation, this method uses that implementation to perform the comparison; otherwise, the implementation of is used.

  is .

  -or-

  is .

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Collections.ICollection Implemented to support the interface. [Note: For more information, see .]

  A containing the keys of the current instance.

  This property is read-only.

  As described above.

  The order of the keys in the is unspecified, but it is the same order as the associated values in the returned by the method.

  The returned is a reference to the current instance, not a static copy. Therefore, changes to the current instance continue to be reflected in the .

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Void `` To be added. To be added. To be added. 1.0.5000.0 2.0.0.0
- Method
  System.Void `` The key of the entry to remove.

  Removes the entry with the specified key from the current instance.

  This method is implemented to support the interface.

  As described above.

  This method uses the implementation of to locate it in the current instance. If is found in the current instance, the values of both and its associated value are set to . If is not found in the current instance, no exception is thrown and the current instance remains unchanged.

  is .

  The current instance is read-only or has a fixed size.

  0
  1.0.5000.0
  2.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
- Method
  System.Collections.Hashtable `` The to synchronize.

  Returns a synchronized (thread-safe) wrapper for the specified .

  A synchronized (thread-safe) wrapper for .

  This method returns a new instance that contains values equal to the values of , and provides synchronized access to those values.

  If more than one thread is to write to a concurrently, all write operations are required to be done through this wrapper.

  A can safely support one writer and multiple readers concurrently.

  is . 0 1.0.5000.0 2.0.0.0
- Property
  System.Object

  Gets a that can be used to synchronize access to the current instance.

  A that can be used to synchronize access to the current instance.

  This property is read-only.

  A thread is required to perform synchronized operations only on the of a , not directly on the table itself. This maintains proper synchronization with any other threads concurrently modifying the table.

  This property is implemented to support the interface.

  As described above.

  This method returns a reference to the current instance.

  Override this property to return an object on which to lock when implementing a collection that wraps another collection (using a subset of it, for example). This is useful when providing synchronized access through two or more wrapper collections to the same underlying collection. Typically, this property returns a reference to the current instance.

  Use this property to obtain a that can be used to synchronize access to the current instance.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Collections.IEnumerator Implemented to support the interface. [Note: For more information, see .] To be added. To be added. 1.0.5000.0 2.0.0.0
- Property
  System.Collections.ICollection

  Gets a containing the values of the current instance.

  A containing the values of the current instance.

  This property is read-only.

  As described above.

  The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the method.

  The returned is a reference to the current instance, not a static copy. Therefore, changes to the current instance continue to be reflected in the .

  0
  1.0.5000.0
  2.0.0.0
0