Codota Logo
ComparisonMode.isApproximative
Code IndexAdd Codota to your IDE (free)

How to use
isApproximative
method
in
org.apache.sis.util.ComparisonMode

Best Java code snippets using org.apache.sis.util.ComparisonMode.isApproximative (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.apache.sis.core/sis-utility

/**
 * Returns {@code true} if the given values are approximatively equal given the comparison mode.
 * In mode {@code APPROXIMATIVE} or {@code DEBUG}, this method will compute a relative comparison
 * threshold from the {@link #COMPARISON_THRESHOLD} constant.
 *
 * <p>This method does not thrown {@link AssertionError} in {@link ComparisonMode#DEBUG}.
 * It is caller responsibility to handle the {@code DEBUG} case.</p>
 *
 * @param  v1    the first value to compare.
 * @param  v2    the second value to compare.
 * @param  mode  the comparison mode to use for comparing the numbers.
 * @return {@code true} if both values are considered equal for the given comparison mode.
 */
public static boolean epsilonEqual(final double v1, final double v2, final ComparisonMode mode) {
  if (mode.isApproximative()) {
    final double mg = max(abs(v1), abs(v2));
    if (mg != Double.POSITIVE_INFINITY) {
      return epsilonEqual(v1, v2, COMPARISON_THRESHOLD * mg);
    }
  }
  return equals(v1, v2);
}
origin: org.apache.sis.core/sis-utility

/**
 * Compares this converter with the given object for equality, optionally ignoring rounding errors.
 */
@Override
public boolean equals(final Object other, final ComparisonMode mode) {
  if (mode.isApproximative()) {
    return (other instanceof LinearConverter) && equivalent((LinearConverter) other);
  } else {
    return equals(other);
  }
}
origin: apache/sis

/**
 * Compares this converter with the given object for equality, optionally ignoring rounding errors.
 */
@Override
public boolean equals(final Object other, final ComparisonMode mode) {
  if (mode.isApproximative()) {
    return (other instanceof LinearConverter) && equivalent((LinearConverter) other);
  } else {
    return equals(other);
  }
}
origin: apache/sis

/**
 * Returns {@code true} if the given values are approximately equal given the comparison mode.
 * In mode {@code APPROXIMATIVE} or {@code DEBUG}, this method will compute a relative comparison
 * threshold from the {@link #COMPARISON_THRESHOLD} constant.
 *
 * <p>This method does not thrown {@link AssertionError} in {@link ComparisonMode#DEBUG}.
 * It is caller responsibility to handle the {@code DEBUG} case.</p>
 *
 * @param  v1    the first value to compare.
 * @param  v2    the second value to compare.
 * @param  mode  the comparison mode to use for comparing the numbers.
 * @return {@code true} if both values are considered equal for the given comparison mode.
 */
public static boolean epsilonEqual(final double v1, final double v2, final ComparisonMode mode) {
  if (mode.isApproximative()) {
    final double mg = max(abs(v1), abs(v2));
    if (mg != Double.POSITIVE_INFINITY) {
      return epsilonEqual(v1, v2, COMPARISON_THRESHOLD * mg);
    }
  }
  return equals(v1, v2);
}
origin: apache/sis

if (!mode.isApproximative()) {
  final int tc = hashCode;
  if (tc != 0) {
origin: org.apache.sis.core/sis-referencing

if (!mode.isApproximative()) {
  final int tc = hashCode;
  if (tc != 0) {
origin: org.apache.sis.core/sis-referencing

  return false;
final boolean isApproximative = mode.isApproximative();
if (!isApproximative && getClass() == object.getClass()) {
  if (!equalsSameClass(object)) {
origin: apache/sis

  return false;
final boolean isApproximative = mode.isApproximative();
if (!isApproximative && getClass() == object.getClass()) {
  if (!equalsSameClass(object)) {
origin: org.apache.sis.core/sis-referencing

  return false;
final UnitConverter c = mode.isApproximative() ? unit.getConverterTo(Units.METRE) : null;
boolean isMinor = false;
double v1 = this.getSemiMajorAxis();
origin: apache/sis

  return false;
final UnitConverter c = mode.isApproximative() ? unit.getConverterTo(Units.METRE) : null;
boolean isMinor = false;
double v1 = this.getSemiMajorAxis();
org.apache.sis.utilComparisonModeisApproximative

Javadoc

Returns true if this comparison uses a tolerance threshold. This method currently returns true for APPROXIMATIVE or DEBUG only, but this list may be extended in future SIS versions.

Popular methods of ComparisonMode

  • isIgnoringMetadata
    Returns true if this comparison ignores metadata. This method currently returns true for IGNORE_META
  • equalityLevel
    If the two given objects are equal according one of the modes enumerated in this class, then returns
  • ordinal

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Join (org.hibernate.mapping)
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now