class Hashtable

in global :: System . Collections

Represents a collection of key/value pairs that are organized based on the hash code of the key.


public Hashtable( IDictionary d )

Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the default load factor, hash code provider, and comparer.

  • d The object to copy to a new object.

public Hashtable( IDictionary d, IEqualityComparer equalityComparer )

Initializes a new instance of the class by copying the elements from the specified dictionary to a new object. The new object has an initial capacity equal to the number of elements copied, and uses the default load factor and the specified object.

  • d The object to copy to a new object.
  • equalityComparer The object that defines the hash code provider and the comparer to use with the . -or- to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of .

public Hashtable( IDictionary d, IHashCodeProvider hcp, IComparer comparer )

Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the default load factor, and the specified hash code provider and comparer. This API is obsolete. For an alternative, see .

  • d The object to copy to a new object.
  • hcp The object that supplies the hash codes for all keys in the . -or- to use the default hash code provider, which is each key's implementation of .
  • comparer The object to use to determine whether two keys are equal. -or- to use the default comparer, which is each key's implementation of .

public Hashtable( IDictionary d, float loadFactor )

Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new 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.

  • d The object to copy to a new object.
  • loadFactor A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets.

public Hashtable( IDictionary d, float loadFactor, IEqualityComparer equalityComparer )

Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the specified load factor and object.

  • d The object to copy to a new object.
  • loadFactor A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets.
  • equalityComparer The object that defines the hash code provider and the comparer to use with the . -or- to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of .

public Hashtable( IDictionary d, float loadFactor, IHashCodeProvider hcp, IComparer comparer )

Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the specified load factor, hash code provider, and comparer.

  • d The object to copy to a new object.
  • loadFactor A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets.
  • hcp The object that supplies the hash codes for all keys in the . -or- to use the default hash code provider, which is each key's implementation of .
  • comparer The object to use to determine whether two keys are equal. -or- to use the default comparer, which is each key's implementation of .

public Hashtable( IEqualityComparer equalityComparer )

Initializes a new, empty instance of the class using the default initial capacity and load factor, and the specified object.

  • equalityComparer The object that defines the hash code provider and the comparer to use with the object. -or- to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of .

public Hashtable( IHashCodeProvider hcp, IComparer comparer )

Initializes a new, empty instance of the class using the default initial capacity and load factor, and the specified hash code provider and comparer.

  • hcp The object that supplies the hash codes for all keys in the object. -or- to use the default hash code provider, which is each key's implementation of .
  • comparer The object to use to determine whether two keys are equal. -or- to use the default comparer, which is each key's implementation of .

public Hashtable( int capacity )

Initializes a new, empty instance of the class using the specified initial capacity, and the default load factor, hash code provider, and comparer.

  • capacity The approximate number of elements that the object can initially contain.

public Hashtable( int capacity, IEqualityComparer equalityComparer )

Initializes a new, empty instance of the class using the specified initial capacity and , and the default load factor.

  • capacity The approximate number of elements that the object can initially contain.
  • equalityComparer The object that defines the hash code provider and the comparer to use with the . -or- to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of .

public Hashtable( int capacity, IHashCodeProvider hcp, IComparer comparer )

Initializes a new, empty instance of the class using the specified initial capacity, hash code provider, comparer, and the default load factor.

  • capacity The approximate number of elements that the object can initially contain.
  • hcp The object that supplies the hash codes for all keys in the . -or- to use the default hash code provider, which is each key's implementation of .
  • comparer The object to use to determine whether two keys are equal. -or- to use the default comparer, which is each key's implementation of .

public Hashtable( int capacity, float loadFactor )

Initializes a new, empty instance of the class using the specified initial capacity and load factor, and the default hash code provider and comparer.

  • capacity The approximate number of elements that the object can initially contain.
  • loadFactor A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets.

public Hashtable( int capacity, float loadFactor, IEqualityComparer equalityComparer )

Initializes a new, empty instance of the class using the specified initial capacity, load factor, and object.

  • capacity The approximate number of elements that the object can initially contain.
  • loadFactor A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets.
  • equalityComparer The object that defines the hash code provider and the comparer to use with the . -or- to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of .

public Hashtable( int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer )

Initializes a new, empty instance of the class using the specified initial capacity, load factor, hash code provider, and comparer.

  • capacity The approximate number of elements that the object can initially contain.
  • loadFactor A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets.
  • hcp The object that supplies the hash codes for all keys in the . -or- to use the default hash code provider, which is each key's implementation of .
  • comparer The object to use to determine whether two keys are equal. -or- to use the default comparer, which is each key's implementation of .

public void Add( object key, object value )

Adds an element with the specified key and value into the .

  • key The key of the element to add.
  • value The value of the element to add. The value can be .

public bool Contains( object key )

Determines whether the contains a specific key.

  • key The key to locate in the .
  • Returns if the contains an element with the specified key; otherwise, .

public bool ContainsKey( object key )

Determines whether the contains a specific key.

  • key The key to locate in the .
  • Returns if the contains an element with the specified key; otherwise, .

public bool ContainsValue( object value )

Determines whether the contains a specific value.

  • value The value to locate in the . The value can be .
  • Returns if the contains an element with the specified ; otherwise, .

public void CopyTo( Array array, int arrayIndex )

Copies the elements to a one-dimensional instance at the specified index.

  • array The one-dimensional that is the destination of the objects copied from . The must have zero-based indexing.
  • arrayIndex The zero-based index in at which copying begins.

public int Count { get; }

Gets the number of key/value pairs contained in the .

  • Returns The number of key/value pairs contained in the .

public void GetObjectData( SerializationInfo info, StreamingContext context )

Implements the interface and returns the data needed to serialize the .

  • info A object containing the information required to serialize the .
  • context A object containing the source and destination of the serialized stream associated with the .

public bool IsFixedSize { get; }

Gets a value indicating whether the has a fixed size.

  • Returns if the has a fixed size; otherwise, . The default is .

public bool IsReadOnly { get; }

Gets a value indicating whether the is read-only.

  • Returns if the is read-only; otherwise, . The default is .

public bool IsSynchronized { get; }

Gets a value indicating whether access to the is synchronized (thread safe).

  • Returns if access to the is synchronized (thread safe); otherwise, . The default is .

public ICollection Keys { get; }

Gets an containing the keys in the .

  • Returns An containing the keys in the .

public void OnDeserialization( object sender )

Implements the interface and raises the deserialization event when the deserialization is complete.

  • sender The source of the deserialization event.

public void Remove( object key )

Removes the element with the specified key from the .

  • key The key of the element to remove.

public static Hashtable Synchronized( Hashtable table )

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

  • table The to synchronize.
  • Returns A synchronized (thread-safe) wrapper for the .

public object SyncRoot { get; }

Gets an object that can be used to synchronize access to the .

  • Returns An object that can be used to synchronize access to the .

public ICollection Values { get; }

Gets an containing the values in the .

  • Returns An containing the values in the .

public int GetHashCode( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public IDictionaryEnumerator GetEnumerator( )

😔 No documentation found.

public object Item { get; set; }

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public object Clone( )

😔 No documentation found.

public void Clear( )

😔 No documentation found.

public Hashtable( )

😔 No documentation found.