- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {SimpleDateFormat s =
String pattern;new SimpleDateFormat(pattern)
String template;Locale locale;new SimpleDateFormat(template, locale)
new SimpleDateFormat()
- Smart code suggestions by Codota
}
/** * 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); }
/** * 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); } }
/** * 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); } }
/** * 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); }
if (!mode.isApproximative()) { final int tc = hashCode; if (tc != 0) {
if (!mode.isApproximative()) { final int tc = hashCode; if (tc != 0) {
return false; final boolean isApproximative = mode.isApproximative(); if (!isApproximative && getClass() == object.getClass()) { if (!equalsSameClass(object)) {
return false; final boolean isApproximative = mode.isApproximative(); if (!isApproximative && getClass() == object.getClass()) { if (!equalsSameClass(object)) {
return false; final UnitConverter c = mode.isApproximative() ? unit.getConverterTo(Units.METRE) : null; boolean isMinor = false; double v1 = this.getSemiMajorAxis();
return false; final UnitConverter c = mode.isApproximative() ? unit.getConverterTo(Units.METRE) : null; boolean isMinor = false; double v1 = this.getSemiMajorAxis();