com.mapbox.mapboxsdk.utils.Compare Maven / Gradle / Ivy
package com.mapbox.mapboxsdk.utils;
/**
* Comparisons from std sdk, which aren't available in API level <= 15
*/
public class Compare {
/**
* @see Integer#compare(int, int)
* @param x left side
* @param y right side
* @return std compare value
*/
public static int compare(int x, int y) {
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
/**
* @see Boolean#compare(boolean, boolean)
* @param x left side
* @param y right side
* @return std compare value
*/
public static int compare(boolean x, boolean y) {
return (x == y) ? 0 : (x ? 1 : -1);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy