/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TShortObjectMap ) ) { return false; } TShortObjectMap that = ( TShortObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TShortObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); short 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 TShortObjectMap ) ) { return false; } TShortObjectMap that = ( TShortObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TShortObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); short 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 TShortObjectIterator<V> iterator() { return new TShortObjectHashIterator<V>( this ); }
/** {@inheritDoc} */ @Override public TShortObjectIterator<V> iterator() { return new TShortObjectHashIterator( this ); }
public TShortObjectIterator<V> iterator() { return container.iterator(); }
public TShortObjectIterator<String> iterator() { return container.iterator(); }
/** * Returns a <tt>TShortObjectIterator</tt> with access to this map's keys and values. * * @return a <tt>TShortObjectIterator</tt> with access to this map's keys and values. */ public TShortObjectIterator<V> iterator();