/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TCharObjectMap ) ) { return false; } TCharObjectMap that = ( TCharObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TCharObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); char 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 ) { // unused. } return true; }
/** {@inheritDoc} */ @Override @SuppressWarnings("rawtypes") public boolean equals( Object other ) { if ( ! ( other instanceof TCharObjectMap ) ) { return false; } TCharObjectMap that = ( TCharObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TCharObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); char 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 ) { // unused. } return true; }
/** {@inheritDoc} */ public TCharObjectIterator<V> iterator() { return new TCharObjectHashIterator<V>( this ); }
@Override public TCharObjectIterator iterator() { return null; }
/** {@inheritDoc} */ @Override public TCharObjectIterator<V> iterator() { return new TCharObjectHashIterator( this ); }
/** * Returns a <tt>TCharObjectIterator</tt> with access to this map's keys and values. * * @return a <tt>TCharObjectIterator</tt> with access to this map's keys and values. */ public TCharObjectIterator<V> iterator();