Ecco cosa ha la Hashtable in C#:
Codice PHP:
// Summary:
// Adds an element with the specified key and value into the System.Collections.Hashtable.
//
// Parameters:
// value:
// The value of the element to add. The value can be null.
//
// key:
// The key of the element to add.
//
// Exceptions:
// System.NotSupportedException:
// The System.Collections.Hashtable is read-only.-or- The System.Collections.Hashtable
// has a fixed size.
//
// System.ArgumentException:
// An element with the same key already exists in the System.Collections.Hashtable.
//
// System.ArgumentNullException:
// key is null.
public virtual void Add(object key, object value);
//
// Summary:
// Removes all elements from the System.Collections.Hashtable.
//
// Exceptions:
// System.NotSupportedException:
// The System.Collections.Hashtable is read-only.
[ReliabilityContract(3, 2)]
public virtual void Clear();
//
// Summary:
// Creates a shallow copy of the System.Collections.Hashtable.
//
// Returns:
// A shallow copy of the System.Collections.Hashtable.
public virtual object Clone();
//
// Summary:
// Determines whether the System.Collections.Hashtable contains a specific key.
//
// Parameters:
// key:
// The key to locate in the System.Collections.Hashtable.
//
// Returns:
// true if the System.Collections.Hashtable contains an element with the specified
// key; otherwise, false.
//
// Exceptions:
// System.ArgumentNullException:
// key is null.
public virtual bool Contains(object key);
//
// Summary:
// Determines whether the System.Collections.Hashtable contains a specific key.
//
// Parameters:
// key:
// The key to locate in the System.Collections.Hashtable.
//
// Returns:
// true if the System.Collections.Hashtable contains an element with the specified
// key; otherwise, false.
//
// Exceptions:
// System.ArgumentNullException:
// key is null.
public virtual bool ContainsKey(object key);
//
// Summary:
// Determines whether the System.Collections.Hashtable contains a specific value.
//
// Parameters:
// value:
// The value to locate in the System.Collections.Hashtable. The value can be
// null.
//
// Returns:
// true if the System.Collections.Hashtable contains an element with the specified
// value; otherwise, false.
public virtual bool ContainsValue(object value);
//
// Summary:
// Copies the System.Collections.Hashtable elements to a one-dimensional System.Array
// instance at the specified index.
//
// Parameters:
// array:
// The one-dimensional System.Array that is the destination of the System.Collections.DictionaryEntry
// objects copied from System.Collections.Hashtable. The System.Array must have
// zero-based indexing.
//
// arrayIndex:
// The zero-based index in array at which copying begins.
//
// Exceptions:
// System.ArgumentNullException:
// array is null.
//
// System.InvalidCastException:
// The type of the source System.Collections.Hashtable cannot be cast automatically
// to the type of the destination array.
//
// System.ArgumentOutOfRangeException:
// arrayIndex is less than zero.
//
// System.ArgumentException:
// array is multidimensional.-or- arrayIndex is equal to or greater than the
// length of array.-or- The number of elements in the source System.Collections.Hashtable
// is greater than the available space from arrayIndex to the end of the destination
// array.
public virtual void CopyTo(Array array, int arrayIndex);
//
// Summary:
// Returns an System.Collections.IDictionaryEnumerator that iterates through
// the System.Collections.Hashtable.
//
// Returns:
// An System.Collections.IDictionaryEnumerator for the System.Collections.Hashtable.
public virtual IDictionaryEnumerator GetEnumerator();
//
// Summary:
// Returns the hash code for the specified key.
//
// Parameters:
// key:
// The System.Object for which a hash code is to be returned.
//
// Returns:
// The hash code for key.
//
// Exceptions:
// System.NullReferenceException:
// key is null.
protected virtual int GetHash(object key);
//
// Summary:
// Implements the System.Runtime.Serialization.ISerializable interface and returns
// the data needed to serialize the System.Collections.Hashtable.
//
// Parameters:
// context:
// A System.Runtime.Serialization.StreamingContext object containing the source
// and destination of the serialized stream associated with the System.Collections.Hashtable.
//
// info:
// A System.Runtime.Serialization.SerializationInfo object containing the information
// required to serialize the System.Collections.Hashtable.
//
// Exceptions:
// System.ArgumentNullException:
// info is null.
public virtual void GetObjectData(SerializationInfo info, StreamingContext context);
//
// Summary:
// Compares a specific System.Object with a specific key in the System.Collections.Hashtable.
//
// Parameters:
// item:
// The System.Object to compare with key.
//
// key:
// The key in the System.Collections.Hashtable to compare with item.
//
// Returns:
// true if item and key are equal; otherwise, false.
//
// Exceptions:
// System.ArgumentNullException:
// item is null.-or- key is null.
protected virtual bool KeyEquals(object item, object key);
//
// Summary:
// Implements the System.Runtime.Serialization.ISerializable interface and raises
// the deserialization event when the deserialization is complete.
//
// Parameters:
// sender:
// The source of the deserialization event.
//
// Exceptions:
// System.Runtime.Serialization.SerializationException:
// The System.Runtime.Serialization.SerializationInfo object associated with
// the current System.Collections.Hashtable is invalid.
public virtual void OnDeserialization(object sender);
//
// Summary:
// Removes the element with the specified key from the System.Collections.Hashtable.
//
// Parameters:
// key:
// The key of the element to remove.
//
// Exceptions:
// System.NotSupportedException:
// The System.Collections.Hashtable is read-only.-or- The System.Collections.Hashtable
// has a fixed size.
//
// System.ArgumentNullException:
// key is null.
[ReliabilityContract(3, 1)]
public virtual void Remove(object key);
//
// Summary:
// Returns a synchronized (thread safe) wrapper for the System.Collections.Hashtable.
//
// Parameters:
// table:
// The System.Collections.Hashtable to synchronize.
//
// Returns:
// A synchronized (thread safe) wrapper for the System.Collections.Hashtable.
//
// Exceptions:
// System.ArgumentNullException:
// table is null.
public static Hashtable Synchronized(Hashtable table);