/** {@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; }
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION in.readByte(); // MAP //noinspection unchecked _map = ( TShortObjectMap<V> ) in.readObject(); }
/** {@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; }
@Override @SuppressWarnings("unchecked") public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { // VERSION in.readByte(); // MAP //noinspection unchecked _map = ( TShortObjectMap<V> ) in.readObject(); }
/** {@inheritDoc} */ public void putAll( TShortObjectMap<? extends V> map ){ map.forEachEntry( PUT_ALL_PROC ); }
/** {@inheritDoc} */ @Override public void putAll( TShortObjectMap<? extends V> map ){ map.forEachEntry( PUT_ALL_PROC ); }
/** {@inheritDoc} */ public void putAll( TShortObjectMap<V> map ){ map.forEachEntry( PUT_ALL_PROC ); }
public TShortObjectMap<V> getMap() { return container; }
public TShortObjectMap<String> getMap() { return container; }
/** * Creates a new <code>TShortObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TShortObjectMap</tt> to be copied. */ public TShortObjectHashMap( TShortObjectMap<? extends V> map ) { this( map.size(), 0.5f, map.getNoEntryKey() ); putAll( map ); }
/** * Creates a wrapper that decorates the specified primitive map. * * @param map the <tt>TShortObjectMap</tt> to wrap. */ public TShortObjectMapDecorator( TShortObjectMap<V> map ) { super(); this._map = map; }
/** * Returns a reference to the map wrapped by this decorator. * * @return the wrapped <tt>TShortObjectMap</tt> instance. */ public TShortObjectMap<V> getMap() { return _map; }
/** * Creates a new <code>TShortObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TShortObjectMap</tt> to be copied. */ public TShortObjectHashMap( TShortObjectMap<V> map ) { this( map.size(), 0.5f, map.getNoEntryKey() ); putAll( map ); }