/** * @brief See if the given object is an XMRArrayListKey and every value is equal to our own. */ public override bool Equals(object o) { if (!(o is XMRArrayListKey)) { return(false); } XMRArrayListKey a = (XMRArrayListKey)o; int len = a.length; if (len != length) { return(false); } if (a.hashCode != hashCode) { return(false); } for (int i = 0; i < len; i++) { if (!cleaned[i].Equals(a.cleaned[i])) { return(false); } } return(true); }
private static int MyListKeyComparer(object a, object b) { XMRArrayListKey alk = (XMRArrayListKey)a; XMRArrayListKey blk = (XMRArrayListKey)b; return(XMRArrayListKey.Compare(alk, blk)); }
/** * @brief Compare for key sorting. */ public static int Compare(XMRArrayListKey x, XMRArrayListKey y) { int j = x.length - y.length; if (j == 0) { for (int i = 0; i < x.length; i++) { object xo = x.cleaned[i]; object yo = y.cleaned[i]; j = XMRArrayKeyComparer.singleton.Compare(xo, yo); if (j != 0) { break; } } } return(j); }