Here you can find the source of isEqual(BigDecimal aLhs, BigDecimal aRhs)
Parameter | Description |
---|---|
aLhs | a parameter |
aRhs | a parameter |
public static boolean isEqual(BigDecimal aLhs, BigDecimal aRhs)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.math.BigDecimal; import java.util.Collection; import java.util.Date; import java.util.Iterator; public class Main { /**/*from w w w . j a v a 2 s. c om*/ * FILLIN * * @param aLhs * @param aRhs * * @return */ public static boolean isEqual(boolean aLhs, boolean aRhs) { return (aLhs == aRhs); } /** * FILLIN * * @param aLhs * @param aRhs * * @return */ public static boolean isEqual(int aLhs, int aRhs) { return (aLhs == aRhs); } /** * FILLIN * * @param aLhs * @param aRhs * * @return */ public static <T> boolean isEqual(T aLhs, T aRhs) { return ((aLhs == null && aRhs == null) || (aLhs != null && aRhs != null && aLhs.equals(aRhs))); } /** * FILLIN * * @param aLhs * @param aRhs * * @return */ public static boolean isEqual(BigDecimal aLhs, BigDecimal aRhs) { return ((aLhs == null && aRhs == null) || (aLhs != null && aRhs != null && aLhs.compareTo(aRhs) == 0)); } /** * FILLIN * * @param aLhs * @param aRhs * * @return */ public static boolean isEqual(Date aLhs, Date aRhs) { return ((aLhs == null && aRhs == null) || (aLhs != null && aRhs != null && (aLhs.getTime() / 1000) == (aRhs.getTime() / 1000))); } /** * FILLIN * * @param aLhsSet * @param aRhsSet * * @return */ public static <T> boolean isEqual(Collection<T> aLhsSet, Collection<T> aRhsSet) { boolean myIsEqual = false; if (aLhsSet != null && aRhsSet != null) { if (aLhsSet.size() == aRhsSet.size()) { myIsEqual = true; Iterator<T> myLhsIterator = aLhsSet.iterator(); Iterator<T> myRhsIterator = aRhsSet.iterator(); while (myLhsIterator.hasNext()) { Object myLhs = myLhsIterator.next(); Object myRhs = myRhsIterator.next(); myIsEqual = myLhs.equals(myRhs); } } } else if (aLhsSet == null && aRhsSet == null) { myIsEqual = true; } return myIsEqual; } }