Method CompareTo
CompareTo(Object)
Compares this instance to the value specified.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The value to compare to. |
Returns
Type | Description |
---|---|
System.Int32 |
CompareTo(T)
Compares this instance to a value of {T}.
Declaration
public int CompareTo(T other)
Parameters
Type | Name | Description |
---|---|---|
T | other | The value to compare to. |
Returns
Type | Description |
---|---|
System.Int32 | -1 if this is less than other, 0 if this is equal to other, or 1 if this is greater than other. |
Remarks
If this instance is empty, then it is considered 'less than' other
. Otherwise Comparer{T}.Default is used to compare this instance's inner value to other
.
CompareTo(Maybe<T>)
Compares this instance to another instance of Maybe{T}.
Declaration
public int CompareTo(Maybe<T> other)
Parameters
Type | Name | Description |
---|---|---|
Maybe<T> | other | Another Maybe<T> to compare this instance with. |
Returns
Type | Description |
---|---|
System.Int32 | -1 if this is less than other, 0 if this is equal to other, or 1 if this is greater than other. |