Java Number Equal areEqual(boolean aThis, boolean aThat)

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

Description

are Equal

License

Open Source License

Declaration

static public boolean areEqual(boolean aThis, boolean aThat) 

Method Source Code

//package com.java2s;

public class Main {
    static public boolean areEqual(boolean aThis, boolean aThat) {
        //System.out.println("boolean");
        return aThis == aThat;
    }/*from  w  w  w .  j  a  va2  s . c  o  m*/

    static public boolean areEqual(char aThis, char aThat) {
        //System.out.println("char");
        return aThis == aThat;
    }

    static public boolean areEqual(long aThis, long aThat) {
        /*
        * Implementation Note
        * Note that byte, short, and int are handled by this method, through
        * implicit conversion.
        */
        //System.out.println("long");
        return aThis == aThat;
    }

    static public boolean areEqual(float aThis, float aThat) {
        //System.out.println("float");
        return Float.floatToIntBits(aThis) == Float.floatToIntBits(aThat);
    }

    static public boolean areEqual(double aThis, double aThat) {
        //System.out.println("double");
        return Double.doubleToLongBits(aThis) == Double.doubleToLongBits(aThat);
    }

    /**
    * Possibly-null object field.
    *
    * Includes type-safe enumerations and collections, but does not include
    * arrays. See class comment.
    */
    static public boolean areEqual(Object aThis, Object aThat) {
        //    System.out.println("Object");
        return aThis == null ? aThat == null : aThis.equals(aThat);
    }

    static public boolean areEqual(Object[] aThis, Object[] aThat) {
        //    System.out.println("Array");
        if (aThis.length != aThat.length)
            return false;

        for (int i = 0; i < aThis.length; i++) {
            if (!aThis[i].equals(aThat[i]))
                return false;
        }

        return true;
    }
}

Related

  1. areEqual(boolean aThis, boolean aThat)
  2. areEqual(boolean aThis, boolean aThat)
  3. areEqual(boolean c1, boolean c2)
  4. areEqual(double d1, double d2)
  5. areEqual(double one, double two)