/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean equals( Object other ) { if ( ! ( other instanceof TObjectCharMap ) ) { return false; } TObjectCharMap that = ( TObjectCharMap ) other; if ( that.size() != this.size() ) { return false; } try { TObjectCharIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); Object key = iter.key(); char value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) { return false; } } else { if ( value != that.get( key ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. } return true; }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @Override @SuppressWarnings("rawtypes") public boolean equals( Object other ) { if ( ! ( other instanceof TObjectCharMap ) ) { return false; } TObjectCharMap that = ( TObjectCharMap ) other; if ( that.size() != this.size() ) { return false; } try { TObjectCharIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); Object key = iter.key(); char value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) { return false; } } else { if ( value != that.get( key ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. } return true; }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean equals( Object other ) { if ( ! ( other instanceof TObjectCharMap ) ) { return false; } TObjectCharMap that = ( TObjectCharMap ) other; if ( that.size() != this.size() ) { return false; } try { TObjectCharIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); Object key = iter.key(); char value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) { return false; } } else { if ( value != that.get( key ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. logger.warn("An error occurred!", ex); } return true; }
/** * @return an iterator over the entries in this map */ public TObjectCharIterator<K> iterator() { return new TObjectCharHashIterator<K>( this ); }
/** * @return an iterator over the entries in this map */ @Override public TObjectCharIterator<K> iterator() { return new TObjectCharHashIterator( this ); }
/** * Returns a <tt>TObjectCharIterator</tt> with access to this map's keys and values. * * @return a <tt>TObjectCharIterator</tt> with access to this map's keys and values. */ public TObjectCharIterator<K> iterator();