Search Results for

    Show / Hide Table of Contents

    Class CoordinateCompare

    CoordinateCompare is used in the sorting of arrays of Coordinate objects. Implements a lexicographic comparison.

    Inheritance
    object
    CoordinateCompare
    Implements
    IComparer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Utilities
    Assembly: NetTopologySuite.dll
    Syntax
    public class CoordinateCompare : IComparer

    Methods

    | Edit this page View Source

    Compare(object, object)

    Compares two object and returns a value indicating whether one is less than, equal to or greater than the other.

    Declaration
    public int Compare(object x, object y)
    Parameters
    Type Name Description
    object x

    First Coordinate object to compare.

    object y

    Second Coordinate object to compare.

    Returns
    Type Description
    int

    <table cellspacing="0" class="dtTABLE"> <TR VALIGN="top"> <TH width=50%>Value</TH> <TH width=50%>Condition</TH> </TR> <TR VALIGN="top"> <TD width=50%>Less than zero</TD> <TD width=50%><I>a</I> is less than <I>b</I>.</TD> </TR> <TR VALIGN="top"> <TD width=50%>Zero</TD> <TD width=50%><I>a</I> equals <I>b</I>.</TD> </TR> <TR VALIGN="top"> <TD width=50%>Greater than zero</TD> <TD width=50%><I>a</I> is greater than <I>b</I>.</TD> </TR> </table>

    Remarks

    If a implements IComparable, then a. CompareTo (b) is returned; otherwise, if b implements IComparable, then b. CompareTo (a) is returned. Comparing a null reference (Nothing in Visual Basic) with any type is allowed and does not generate an exception when using IComparable. When sorting, a null reference (Nothing) is considered to be less than any other object.

    Implements

    IComparer
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX