/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TDoubleObjectMap ) ) { return false; } TDoubleObjectMap that = ( TDoubleObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TDoubleObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); double 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 = ( TDoubleObjectMap<V> ) in.readObject(); }
/** * {@inheritDoc} */ public boolean equals(final Object other) { if (!(other instanceof TDoubleObjectMap)) { return false; } final TDoubleObjectMap that = (TDoubleObjectMap) other; if (that.size() != this.size()) { return false; } try { final TDoubleObjectIterator iter = this.iterator(); while (iter.hasNext()) { iter.advance(); final double key = iter.key(); final 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 (final ClassCastException ex) { // unused. } return true; }
/** {@inheritDoc} */ @Override @SuppressWarnings("rawtypes") public boolean equals( Object other ) { if ( ! ( other instanceof TDoubleObjectMap ) ) { return false; } TDoubleObjectMap that = ( TDoubleObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TDoubleObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); double 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 = ( TDoubleObjectMap<V> ) in.readObject(); }
/** {@inheritDoc} */ public void putAll( TDoubleObjectMap<? extends V> map ){ map.forEachEntry( PUT_ALL_PROC ); }
/** * {@inheritDoc} */ public void putAll(final TDoubleObjectMap<? extends V> map) { map.forEachEntry(PUT_ALL_PROC); }
/** {@inheritDoc} */ @Override public void putAll( TDoubleObjectMap<? extends V> map ){ map.forEachEntry( PUT_ALL_PROC ); }
/** {@inheritDoc} */ public void putAll( TDoubleObjectMap<V> map ){ map.forEachEntry( PUT_ALL_PROC ); }
/** * Creates a new <code>TDoubleObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TDoubleObjectMap</tt> to be copied. */ public TDoubleObjectHashMap( TDoubleObjectMap<? 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>TDoubleObjectMap</tt> to wrap. */ public TDoubleObjectMapDecorator( TDoubleObjectMap<V> map ) { super(); this._map = map; }
/** * Returns a reference to the map wrapped by this decorator. * * @return the wrapped <tt>TDoubleObjectMap</tt> instance. */ public TDoubleObjectMap<V> getMap() { return _map; }
/** * Creates a new <code>TDoubleObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TDoubleObjectMap</tt> to be copied. */ @SuppressWarnings("unused") public TDoubleObjectHashMap(final TDoubleObjectMap<? extends V> map) { this(map.size(), 0.5f, map.getNoEntryKey()); putAll(map); }
/** * Creates a new <code>TDoubleObjectHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TDoubleObjectMap</tt> to be copied. */ public TDoubleObjectHashMap( TDoubleObjectMap<V> map ) { this( map.size(), 0.5f, map.getNoEntryKey() ); putAll( map ); }