Struct KeyValuePair<K, V>
An entry in a dictionary from K to V.
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Lucene.Net.Support.C5
Assembly: Lucene.Net.dll
Syntax
public struct KeyValuePair<K, V> : IEquatable<KeyValuePair<K, V>>, IShowable, IFormattable
Type Parameters
Name | Description |
---|---|
K | |
V |
Constructors
| Improve this Doc View SourceKeyValuePair(K)
Create an entry with a specified key. The value will be the default value of type
V
.
Declaration
public KeyValuePair(K key)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key |
KeyValuePair(K, V)
Create an entry with specified key and value
Declaration
public KeyValuePair(K key, V value)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key |
V | value | The value |
Fields
| Improve this Doc View SourceKey
The key field of the entry
Declaration
public K Key
Field Value
Type | Description |
---|---|
K |
Value
The value field of the entry
Declaration
public V Value
Field Value
Type | Description |
---|---|
V |
Methods
| Improve this Doc View SourceEquals(KeyValuePair<K, V>)
Declaration
public bool Equals(KeyValuePair<K, V> other)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Check equality of entries.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The other object |
Returns
Type | Description |
---|---|
System.Boolean | True if obj is an entry of the same type and has the same key and value |
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Get the hash code of the pair.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code |
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
Show(StringBuilder, ref Int32, IFormatProvider)
Declaration
public bool Show(StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | stringbuilder | |
System.Int32 | rest | |
System.IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
System.Boolean |
ToString()
Pretty print an entry
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | (key, value) |
Overrides
System.ValueType.ToString()
|
Improve this Doc
View Source
ToString(String, IFormatProvider)
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | |
System.IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
System.String |
Operators
| Improve this Doc View SourceEquality(KeyValuePair<K, V>, KeyValuePair<K, V>)
Declaration
public static bool operator ==(KeyValuePair<K, V> pair1, KeyValuePair<K, V> pair2)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | pair1 | |
KeyValuePair<K, V> | pair2 |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(KeyValuePair<K, V>, KeyValuePair<K, V>)
Declaration
public static bool operator !=(KeyValuePair<K, V> pair1, KeyValuePair<K, V> pair2)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | pair1 | |
KeyValuePair<K, V> | pair2 |
Returns
Type | Description |
---|---|
System.Boolean |
Implements
System.IEquatable<T>
System.IFormattable