All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mapbox.mapboxsdk.utils.Compare Maven / Gradle / Ivy

There is a newer version: 9.2.1
Show newest version
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