Compares two keys using the correct comparison method for this
Collection.
@param k1 The first item to be compared.
@param k2 The second item to be compared.
@return a positive or negative integer if they differ, and zero if
equal.
8059
private int compare(Object k1, Object k2) {
        return (mComparator==null ? ((Comparable)k1).compareTo(k2)
                : mComparator.compare(k1, k2));
    }
352017
public int size(final K1 firstKey, final K2 secondKey) {
		// existence check on inner map
		final HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey);
		if( innerMap1 == null ) {
			return 0;
		}
		
		// existence check on inner map1
		final HashMap<K3, V> innerMap2 = innerMap1.get(secondKey);
		if( innerMap2 == null ) {
			return 0;
		}
		return innerMap2.size();
	}
1098868
public static <T> int compare(T a, T b, Comparator<? super T> c) {
        if (a == b) {
            return 0;
        }
        return c.compare(a, b);
    }
23989
function compareKey(one, two) {
  const delta = one.length - two.length;
  if (delta > 0) {
    return 1;
  }
  if (delta < 0) {
    return -1;
  }
  return one > two ? 1 : -1;
}
174936
private int compare(int i) {

        if (sortOnValues) {
            if (targetSearchValue > values[i]) {
                return 1;
            } else if (targetSearchValue < values[i]) {
                return -1;
            }
        } else {
            if (targetSearchValue > keys[i]) {
                return 1;
            } else if (targetSearchValue < keys[i]) {
                return -1;
            }
        }

        return 0;
    }
955445
public int compare(final SnomedConcept o1, final SnomedConcept o2) {
        if (o1 == o2) return 0;
        if (o1 != null) {
            if (o2 == null) return 1;
            else return o1.phraseText.compareTo(o2.phraseText);
        }
        return -1;
    }
102120
@Override
    public int compare(Morsel o1, Morsel o2) {
        if (o1.getMarker() != null && o2.getMarker() == null) {
            return 1;
        }

        if (o2.getMarker() != null && o1.getMarker() == null) {
            return -1;
        }

        int spaceCompare = o1.getSpaceId().compareTo(o2.getSpaceId());
        if (spaceCompare == 0) {
            return o1.getAccount().compareTo(o2.getAccount());
        } else {
            return spaceCompare;
        }
    }
1170773
public static <X extends Comparable<? super X>> int compare(X x1, X x2) {
		if (x1 == null) return x2 == null ? 0 : -1;
		return x2 == null ? 1 : x1.compareTo(x2);
	}
183290
public static int difference(String s1, String s2) {

        /** @todo: check if this is the standard algorithm */
        if ((s1 == null) || (s2 == null)) {
            return 0;
        }

        s1 = soundex(s1);
        s2 = soundex(s2);

        int e = 0;

        for (int i = 0; i < 4; i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                e++;
            }
        }

        return e;
    }
166374
@Override
  public int compare(S solution1, S solution2) {
    if (solution1 == null) {
      return 1;
    } else if (solution2 == null) {
      return -1;
    }

    double fitness1 = solutionFitness.getAttribute(solution1);
    double fitness2 = solutionFitness.getAttribute(solution2);
    if (fitness1 < fitness2) {
      return -1;
    }

    if (fitness1 > fitness2) {
      return 1;
    }

    return 0;
  }
1317030
public boolean containsKey(final K1 firstKey, final K2 secondKey) {
		// existence check on inner map
		final HashMap<K2, V> innerMap = map.get(firstKey);
		if( innerMap == null ) {
			return false;
		}
		return innerMap.containsKey(secondKey);
	}
568706
@Override
    public final int compare(T o1, T o2){
        if(o1==o2)
            return 0;
        else if(o1==null)
            return -1;
        else if(o2==null)
            return 1;
        else
            return _compare(o1, o2);
    }
507965
@Override
	public int compare(E o1, E o2) {
		return comparator.compare(o2, o1);
	}
899809
function compareKey(one: string, two: string): number {
  const delta = one.length - two.length;
  if (delta > 0) {
    return 1;
  }
  if (delta < 0) {
    return -1;
  }
  return one > two ? 1 : -1;
}
672211
private static int compare(long v1, long v2) {
		int pos = 0;
		if (v1 != v2) {
			long x = v1 ^ v2;
			pos += Long.numberOfLeadingZeros(x);
			return pos;
		}
		return -1;
	}
1131586
public static boolean isLessOrEqual(BigDecimal bigNum1, BigDecimal bigNum2) {
		Assert.notNull(bigNum1);
		Assert.notNull(bigNum2);
		return bigNum1.compareTo(bigNum2) <= 0;
	}
1026482
public int compareTo (final ITrigger other)
  {

    if (other.getKey () == null && getKey () == null)
      return 0;
    if (other.getKey () == null)
      return -1;
    if (getKey () == null)
      return 1;

    return getKey ().compareTo (other.getKey ());
  }