public short getNoEntryValue() { return m.getNoEntryValue(); }
public short getNoEntryValue() { return m.getNoEntryValue(); }
/** * 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 Short(0) if none was found. */ public Short put( Integer key, Short value ) { int k; short v; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } if ( value == null ) { v = _map.getNoEntryValue(); } else { v = unwrapValue( value ); } short retval = _map.put( k, v ); if ( retval == _map.getNoEntryValue() ) { return null; } return wrapValue( retval ); }
/** * 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 */ public Short remove( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } short v = _map.remove( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** * 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. */ public Short get( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } short v = _map.get( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( ! ( other instanceof TIntShortMap ) ) { return false; } TIntShortMap that = ( TIntShortMap ) other; if ( that.size() != this.size() ) { return false; } short[] values = _values; byte[] states = _states; short this_no_entry_value = getNoEntryValue(); short that_no_entry_value = that.getNoEntryValue(); for ( int i = values.length; i-- > 0; ) { if ( states[i] == FULL ) { int key = _set[i]; short that_value = that.get( key ); short 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; }
@Override public short getNoEntryValue() { return m.getNoEntryValue(); }
public short getNoEntryValue() { return m.getNoEntryValue(); }
@Override public short getNoEntryValue() { return m.getNoEntryValue(); }
public short getNoEntryValue() { return m.getNoEntryValue(); }
public short getNoEntryValue() { return m.getNoEntryValue(); }
public short getNoEntryValue() { return m.getNoEntryValue(); }
public short getNoEntryValue() { return m.getNoEntryValue(); }
public short getNoEntryValue() { return m.getNoEntryValue(); }
/** * 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 Short(0) if none was found. */ public Short put( Integer key, Short value ) { int k; short v; if ( key == null ) { k = _map.getNoEntryKey(); } else { k = unwrapKey( key ); } if ( value == null ) { v = _map.getNoEntryValue(); } else { v = unwrapValue( value ); } short retval = _map.put( k, v ); if ( retval == _map.getNoEntryValue() ) { return null; } return wrapValue( retval ); }
/** * 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 Short get( Object key ) { if (! ( key instanceof Integer ) ) { return null; } int k = unwrapKey( key ); short v = _map.get( k ); if (v == _map.getNoEntryValue() && !_map.containsKey( k ) ) { return null; } return wrapValue( v ); }
/** * 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. */ public Short get( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } short v = _map.get( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** * 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 */ public Short remove( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } short v = _map.remove( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** {@inheritDoc} */ @Override public boolean equals( Object other ) { if ( ! ( other instanceof TIntShortMap ) ) { return false; } TIntShortMap that = ( TIntShortMap ) other; if ( that.size() != this.size() ) { return false; } short[] values = _values; byte[] states = _states; short this_no_entry_value = getNoEntryValue(); short that_no_entry_value = that.getNoEntryValue(); for ( int i = values.length; i-- > 0; ) { if ( states[i] == FULL ) { int key = _set[i]; short that_value = that.get( key ); short 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; }
/** * 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. */ public Short get( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } short v = _map.get( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }