Brunet.Symphony.NodeRankComparer.Compare C# (CSharp) Метод

Compare() публичный Метод

public Compare ( object x, object y ) : int
x object
y object
Результат int
    public int Compare(object x, object y) {
      if( x == y ) {
        //This is trivial, but we need to deal with it:
        return 0;
      }
      NodeRankInformation x1 = (NodeRankInformation) x;
      NodeRankInformation y1 = (NodeRankInformation) y;
      if (x1.Equals(y1) && x1.Count == y1.Count) {
        /*
         * Since each Address is in our list at most once,
         * this is an Error, so lets print it out and hope
         * someone sees it.
         */
	      return 0;
      } else if (x1.Count <= y1.Count) {
	      return 1;
      } else if (x1.Count > y1.Count) {
	      return -1;
      }
      return -1;
    }
  }
NodeRankComparer