Java Number Equal areEqual(final char aThis, final char aThat)

Here you can find the source of areEqual(final char aThis, final char aThat)

Description

are Equal

License

Open Source License

Declaration

static public boolean areEqual(final char aThis, final char aThat) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015, 2017 Lablicate GmbH.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:// ww w  .j  a v  a 2s  .c o m
 * Dr. Alexander Kerner - initial API and implementation
 *******************************************************************************/

public class Main {
    static public boolean areEqual(final boolean aThis, final boolean aThat) {

        return aThis == aThat;
    }

    static public boolean areEqual(final char aThis, final char aThat) {

        return aThis == aThat;
    }

    /**
     * Checks equality of two given {@code doubles} by using {@link Double#doubleToLongBits(double)}
     *
     * @param d1
     *            first {@code double}
     * @param d2
     *            second {@code double}
     * @return {@code true} if {@code d1} euqals {@code d2}; {@code false} otherwise
     */
    static public boolean areEqual(final double d1, final double d2) {

        final boolean result = Double.doubleToLongBits(d1) == Double.doubleToLongBits(d2);
        return result;
    }

    static public boolean areEqual(final float aThis, final float aThat) {

        return Float.floatToIntBits(aThis) == Float.floatToIntBits(aThat);
    }

    static public boolean areEqual(final long aThis, final long aThat) {

        return aThis == aThat;
    }

    static public boolean areEqual(final Object aThis, final Object aThat) {

        return aThis == null ? aThat == null : aThis.equals(aThat);
    }
}

Related

  1. areEqual(boolean aThis, boolean aThat)
  2. areEqual(boolean c1, boolean c2)
  3. areEqual(double d1, double d2)
  4. areEqual(double one, double two)
  5. areEqual(final boolean aThis, final boolean aThat)
  6. areEqual(float left, float right)
  7. areEqual(int align, int mask)
  8. areEqual(int i, int j)
  9. areEqual(int o1, int o2)