Click or drag to resize

Pair<TKey, TValue> Class

Defines a key/value pair that is mutable and supports Jumbo's IWritable serialization protocol.
Inheritance Hierarchy
System.Object
  Ookii.Jumbo.IO.Pair<TKey, TValue>

Namespace: Ookii.Jumbo.IO
Assembly: Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 0.3.0+dc1307f20e065bb638e0b73a34cd216f57e486f1
Syntax
public sealed class Pair<TKey, TValue> : IWritable, 
	IComparable<Pair<TKey, TValue>>, IEquatable<Pair<TKey, TValue>>, 
	ICloneable

Type Parameters

TKey
The type of the key.
TValue
The type of the value.

The Pair<TKey, TValue> type exposes the following members.

Constructors
 NameDescription
Public methodPair<TKey, TValue>() Initializes a new instance of the Pair<TKey, TValue> class.
Public methodPair<TKey, TValue>(TKey, TValue) Initializes a new instance of the Pair<TKey, TValue> class with the specified key and value.
Top
Properties
 NameDescription
Public propertyKey Gets or sets the key in the key/value pair.
Public propertyValue Gets or sets the value in the key/value pair.
Top
Methods
 NameDescription
Public methodCompareTo Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Public methodEquals(Object) Determines whether the specified Object is equal to the current Pair<TKey, TValue>.
(Overrides Object.Equals(Object))
Public methodEquals(Pair<TKey, TValue>) Determines whether the specified Pair<TKey, TValue> is equal to the current Pair<TKey, TValue>.
Public methodGetHashCode Serves as a hash function for a particular type.
(Overrides Object.GetHashCode())
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodRead Reads the object from the specified reader.
Public methodToString Gets a string representation of the current Pair<TKey, TValue>.
(Overrides Object.ToString())
Public methodWrite Writes the object to the specified writer.
Top
Operators
 NameDescription
Public operatorStatic memberEquality(Pair<TKey, TValue>, Pair<TKey, TValue>) Determines whether two specified Pair<TKey, TValue> objects have the same value.
Public operatorStatic memberGreaterThan(Pair<TKey, TValue>, Pair<TKey, TValue>) Determines whether one specified Pair<TKey, TValue> is greater than another specified Pair<TKey, TValue>
Public operatorStatic memberGreaterThanOrEqual(Pair<TKey, TValue>, Pair<TKey, TValue>) Determines whether one specified Pair<TKey, TValue> is greater than or equal to another specified Pair<TKey, TValue>
Public operatorStatic memberInequality(Pair<TKey, TValue>, Pair<TKey, TValue>) Determines whether two specified Pair<TKey, TValue> objects have different values.
Public operatorStatic memberLessThan(Pair<TKey, TValue>, Pair<TKey, TValue>) Determines whether one specified Pair<TKey, TValue> is less than another specified Pair<TKey, TValue>
Public operatorStatic memberLessThanOrEqual(Pair<TKey, TValue>, Pair<TKey, TValue>) Determines whether one specified Pair<TKey, TValue> is less than or equal to another specified Pair<TKey, TValue>
Top
Remarks

Jumbo does not support the use of KeyValuePair<TKey, TValue> as a record type. You must use Pair<TKey, TValue> instead.

The IComparable<T> implementation of this class uses the key only; it ignores the value. IEquatable<T> does use both the key and value.

See Also