/** * Returns <code>true</code> iff <i>that</i> Object is * is a {@link Comparator} whose ordering is known to be * equivalent to mine. * <p> * This implementation returns <code>true</code> * iff <code><i>object</i>.{@link Object#getClass() getClass()}</code> * equals <code>this.getClass()</code>, and the underlying * comparators and order bits are equal. * Subclasses may want to override this behavior to remain consistent * with the {@link Comparator#equals(Object)} contract. * * @param object the object to compare with * @return true if equal * @since Commons Collections 3.0 */ public override bool Equals(Object obj) { if (this == obj) { return(true); } else if (null == obj) { return(false); } else if (obj.getClass().Equals(this.getClass())) { ComparatorChain chain = (ComparatorChain)obj; return((null == orderingBits ? null == chain.orderingBits : orderingBits.equals(chain.orderingBits)) && (null == comparatorChain ? null == chain.comparatorChain : comparatorChain.equals(chain.comparatorChain))); } else { return(false); } }