gnu.trove.map.TObjectIntMap.getNoEntryValue()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中gnu.trove.map.TObjectIntMap.getNoEntryValue()方法的一些代码示例,展示了TObjectIntMap.getNoEntryValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TObjectIntMap.getNoEntryValue()方法的具体详情如下:
包路径:gnu.trove.map.TObjectIntMap
类名称:TObjectIntMap
方法名:getNoEntryValue

TObjectIntMap.getNoEntryValue介绍

[英]Returns the value that will be returned from #get or #put if no entry exists for a given key. The default value is generally zero, but can be changed during construction of the collection.
[中]返回如果给定键不存在条目,将从#get或#put返回的值。默认值通常为零,但可以在构建集合期间更改。

代码示例

代码示例来源:origin: alibaba/mdrill

public int getNoEntryValue() { return m.getNoEntryValue(); }

代码示例来源:origin: alibaba/mdrill

public int getNoEntryValue()    { return m.getNoEntryValue(); }

代码示例来源:origin: alibaba/mdrill

/**
 * 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 );
  }
}

代码示例来源:origin: alibaba/mdrill

/**
 * 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 );
  }
}

代码示例来源:origin: alibaba/mdrill

/**
 * 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 );
}

代码示例来源:origin: alibaba/mdrill

/**
 * 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 );
}

代码示例来源:origin: alibaba/mdrill

/**
 * 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 ) ) );
}

代码示例来源:origin: alibaba/mdrill

int value = iter.value();
if ( value == no_entry_value ) {
  if ( !( that.get( key ) == that.getNoEntryValue() &&
    that.containsKey( key ) ) ) {

代码示例来源:origin: alibaba/mdrill

int value = iter.value();
if ( value == no_entry_value ) {
  if ( !( that.get( key ) == that.getNoEntryValue() &&
    that.containsKey( key ) ) ) {

代码示例来源:origin: com.palantir.patches.sourceforge/trove3

@Override
public int getNoEntryValue()    { return m.getNoEntryValue(); }

代码示例来源:origin: net.sf.trove4j/trove4j

public int getNoEntryValue()    { return m.getNoEntryValue(); }

代码示例来源:origin: net.sf.trove4j/trove4j

public int getNoEntryValue() { return m.getNoEntryValue(); }

代码示例来源:origin: hernad/easyrec

public int getNoEntryValue() { return m.getNoEntryValue(); }

代码示例来源:origin: de.unijena.bioinf.phylo/mincut

@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;
}

代码示例来源:origin: hernad/easyrec

/**
 * 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 );
  }
}

代码示例来源:origin: it.unibo.alchemist/alchemist-engine

@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);
  }
}

代码示例来源:origin: net.sf.trove4j/core

/**
 * 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 ) ) );
}

代码示例来源:origin: net.sf.trove4j/trove4j

/**
 * 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 ) ) );
}

代码示例来源:origin: hernad/easyrec

/**
 * 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 ) ) );
}

代码示例来源:origin: com.palantir.patches.sourceforge/trove3

/**
 * 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 ) ) );
}

相关文章