public int getNoEntryValue() { return m.getNoEntryValue(); }
public int getNoEntryValue() { return m.getNoEntryValue(); }
/** * 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 Integer get( Object key ) { int v = _map.get( key ); // 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 Integer(0) if it was not found in the map */ public Integer remove( Object key ) { int v = _map.remove( key ); // 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 ); } }
/** * Creates a new <code>TObjectIntHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TObjectIntMap</tt> to be copied. */ public TObjectIntHashMap( TObjectIntMap<? extends K> map ) { this( map.size(), 0.5f, map.getNoEntryValue() ); if ( map instanceof TObjectIntHashMap ) { TObjectIntHashMap hashmap = ( TObjectIntHashMap ) map; this._loadFactor = hashmap._loadFactor; this.no_entry_value = hashmap.no_entry_value; //noinspection RedundantCast if ( this.no_entry_value != ( int ) 0 ) { Arrays.fill( _values, this.no_entry_value ); } setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); } putAll( map ); }
/** * Creates a new <code>TObjectIntCustomHashMap</code> that contains the entries * in the map passed to it. * * @param map the <tt>TObjectIntMap</tt> to be copied. */ public TObjectIntCustomHashMap( HashingStrategy<? super K> strategy, TObjectIntMap<? extends K> map ) { this( strategy, map.size(), 0.5f, map.getNoEntryValue() ); if ( map instanceof TObjectIntCustomHashMap ) { TObjectIntCustomHashMap hashmap = ( TObjectIntCustomHashMap ) map; this._loadFactor = hashmap._loadFactor; this.no_entry_value = hashmap.no_entry_value; this.strategy = hashmap.strategy; //noinspection RedundantCast if ( this.no_entry_value != ( int ) 0 ) { Arrays.fill( _values, this.no_entry_value ); } setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); } putAll( map ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Integer</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Integer put( K key, Integer value ) { if ( value == null ) return wrapValue( _map.put( key, _map.getNoEntryValue() ) ); return wrapValue( _map.put( key, unwrapValue( value ) ) ); }
int value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) {
int value = iter.value(); if ( value == no_entry_value ) { if ( !( that.get( key ) == that.getNoEntryValue() && that.containsKey( key ) ) ) {
@Override public int getNoEntryValue() { return m.getNoEntryValue(); }
public int getNoEntryValue() { return m.getNoEntryValue(); }
public int getNoEntryValue() { return m.getNoEntryValue(); }
public int getNoEntryValue() { return m.getNoEntryValue(); }
@Override public boolean remove(Object item) { @SuppressWarnings(value = "element-type-mismatch") int id = idx.get(item); if (id == idx.getNoEntryValue()) { return false; } removeAt(id); 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 Integer get( Object key ) { int v = _map.get( key ); // 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 ); } }
@Override public void updateReaction(final Reaction<T> r) { final int index = indexes.get(r); if (index != indexes.getNoEntryValue()) { times.set(index, r.getTau()); updateEffectively(r, index); } }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Integer</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Integer put( K key, Integer value ) { if ( value == null ) return wrapValue( _map.put( key, _map.getNoEntryValue() ) ); return wrapValue( _map.put( key, unwrapValue( value ) ) ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Integer</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Integer put( K key, Integer value ) { if ( value == null ) return wrapValue( _map.put( key, _map.getNoEntryValue() ) ); return wrapValue( _map.put( key, unwrapValue( value ) ) ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Integer</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Integer put( K key, Integer value ) { if ( value == null ) return wrapValue( _map.put( key, _map.getNoEntryValue() ) ); return wrapValue( _map.put( key, unwrapValue( value ) ) ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Integer</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ @Override public Integer put( K key, Integer value ) { if ( value == null ) return wrapValue( _map.put( key, _map.getNoEntryValue() ) ); return wrapValue( _map.put( key, unwrapValue( value ) ) ); }