public boolean containsKey( short key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( double value ){
public boolean containsKey( short key ) { return m.containsKey( key ); } public boolean containsValue( double val ) { return m.containsValue( val ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Short && _map.containsKey( unwrapKey( key ) ); }
@Override public boolean containsKey( short key ) { synchronized( mutex ) { return m.containsKey( key ); } } @Override
public boolean containsKey( short key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( double value ){
public boolean containsKey( short key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( double value ){
public boolean containsKey( short key ) { return m.containsKey( key ); } public boolean containsValue( double val ) { return m.containsValue( val ); }
public boolean containsKey( short key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( double value ){
@Override public boolean containsKey( short key ) { return m.containsKey( key ); } @Override
public boolean containsKey( short key ) { return m.containsKey( key ); } public boolean containsValue( double val ) { return m.containsValue( val ); }
public boolean containsKey( short key ) { return m.containsKey( key ); } public boolean containsValue( double val ) { return m.containsValue( val ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Short && _map.containsKey( unwrapKey( key ) ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Short && _map.containsKey( unwrapKey( key ) ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Short && _map.containsKey( unwrapKey( key ) ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ @Override public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Short && _map.containsKey( unwrapKey( key ) ); }
/** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or null if it was not found in the map */ @Override public Double remove( Object key ) { if (! (key instanceof Short ) ) { return null; } short k = unwrapKey( key ); if ( _map.containsKey( k ) ) { double v = _map.remove( k ); return wrapValue( v ); } return null; }
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ @Override public Double get( Object key ) { if (! ( key instanceof Short ) ) { return null; } short k = unwrapKey( key ); double v = _map.get( k ); if (v == _map.getNoEntryValue() && !_map.containsKey( k ) ) { return null; } return wrapValue( v ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Double(0) if none was found. */ @Override public Double put( Short key, Double value ) { short k = unwrapKey( key ); double v = unwrapValue( value ); if ( _map.containsKey( k ) ) { double retval = _map.put( k, v ); return wrapValue( retval); } _map.put( k, v ); return null; }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( ! ( other instanceof TShortDoubleMap ) ) { return false; } TShortDoubleMap that = ( TShortDoubleMap ) other; if ( that.size() != this.size() ) { return false; } double[] values = _values; byte[] states = _states; double this_no_entry_value = getNoEntryValue(); double that_no_entry_value = that.getNoEntryValue(); for ( int i = values.length; i-- > 0; ) { if ( states[i] == FULL ) { short key = _set[i]; if ( !that.containsKey( key ) ) return false; double that_value = that.get( key ); double this_value = values[i]; if ((this_value != that_value) && ( (this_value != this_no_entry_value) || (that_value != that_no_entry_value)) ) { return false; } } } return true; }