/** {@inheritDoc} */
public boolean equals( Object other ) {
if ( ! ( other instanceof TLongObjectMap ) ) {
return false;
}
TLongObjectMap that = ( TLongObjectMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TLongObjectIterator iter = this.iterator();
while ( iter.hasNext() ) {
iter.advance();
long key = iter.key();
Object value = iter.value();
if ( value == null ) {
if ( !( that.get( key ) == null && that.containsKey( key ) ) ) {
return false;
}
} else {
if ( !value.equals( that.get( key ) ) ) {
return false;
}
}
}
} catch ( ClassCastException ex ) {