Show / Hide Table of Contents
  • MaybeSharp
    • Maybe<T>
      • As
      • Bind
      • Cast
      • CompareTo
      • Equality
      • Equals
      • Explicit
      • GetHashCode
      • GreaterThan
      • GreaterThanOrEqual
      • HasValue
      • Implicit
      • Inequality
      • IsEmpty
      • LessThan
      • LessThanOrEqual
      • Maybe
      • Nothing
      • ToString
      • Value
  • MaybeSharp.Extensions
    • MaybeDictionaryExtensions
      • TryGetValue
    • MaybeExtensions
      • Coalesce
      • Or
      • Select
      • SelectMany
      • SelectNonempty
      • ToNullable
      • ValueOr
      • ValueOrException
      • WhenNothing
      • WhenSomething
      • Where
    • MaybeStringExtensions
      • TryParseBoolean
      • TryParseByte
      • TryParseChar
      • TryParseDateTime
      • TryParseDateTimeOffset
      • TryParseDecimal
      • TryParseDouble
      • TryParseInt
      • TryParseInt16
      • TryParseInt64
      • TryParseSingle
    • NullableExtensions
      • ToMaybe

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.

Back to top Copyright (c) 2017 Troy Willmot