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

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

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

TIntIntMap.getNoEntryKey介绍

[英]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 getNoEntryKey() { return m.getNoEntryKey(); }
public int getNoEntryValue() { return m.getNoEntryValue(); }

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

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

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

/**
 * 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 Integer && _map.containsKey( unwrapKey( key ) );
}

代码示例来源: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 k;
  if ( key != null ) {
    if ( key instanceof Integer ) {
      k = unwrapKey( key );
    } else {
      return null;
    }
  } else {
    k = _map.getNoEntryKey();
  }
  int 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 );
  }
}

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

/**
 * 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 Integer remove( Object key ) {
  int k;
  if ( key != null ) {
    if ( key instanceof Integer ) {
      k = unwrapKey( key );
    } else {
      return null;
    }
  } else {
    k = _map.getNoEntryKey();
  }
  int 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 );
  }
}

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

/**
 * 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 Integer(0) if none was found.
 */
public Integer put( Integer key, Integer value ) {
  int k;
  int v;
  if ( key == null ) {
    k = _map.getNoEntryKey();
  } else {
    k = unwrapKey( key );
  }
  if ( value == null ) {
    v = _map.getNoEntryValue();
  } else {
    v = unwrapValue( value );
  }
  int retval = _map.put( k, v );
  if ( retval == _map.getNoEntryValue() ) {
    return null;
  }
  return wrapValue( retval );
}

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

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

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

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

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

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

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

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

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

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

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

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

代码示例来源:origin: com.conveyal/r5

/**
 * @param streetLayer          needed because we need stopForStreetVertex
 * @param dominanceVariable    according to which dominance variable should states be compared (same as in routing)
 * @param maxStops             maximal number of stops that should be found
 * @param minTravelTimeSeconds for stops that should be still added to list of stops
 */
public StopVisitor(StreetLayer streetLayer, State.RoutingVariable dominanceVariable,
  int maxStops, int minTravelTimeSeconds) {
  this.minTravelTimeSeconds = minTravelTimeSeconds;
  this.streetLayer = streetLayer;
  this.dominanceVariable = dominanceVariable;
  this.maxStops = maxStops;
  this.NO_STOP_FOUND = streetLayer.parentNetwork.transitLayer.stopForStreetVertex
    .getNoEntryKey();
}

代码示例来源:origin: conveyal/r5

/**
 * @param streetLayer          needed because we need stopForStreetVertex
 * @param dominanceVariable    according to which dominance variable should states be compared (same as in routing)
 * @param maxStops             maximal number of stops that should be found
 * @param minTravelTimeSeconds for stops that should be still added to list of stops
 */
public StopVisitor(StreetLayer streetLayer, State.RoutingVariable dominanceVariable,
  int maxStops, int minTravelTimeSeconds) {
  this.minTravelTimeSeconds = minTravelTimeSeconds;
  this.streetLayer = streetLayer;
  this.dominanceVariable = dominanceVariable;
  this.maxStops = maxStops;
  this.NO_STOP_FOUND = streetLayer.parentNetwork.transitLayer.stopForStreetVertex
    .getNoEntryKey();
}

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

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

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

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

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

/**
 * 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 Integer && _map.containsKey( unwrapKey( key ) );
}

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

/**
 * 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 Integer && _map.containsKey( unwrapKey( key ) );
}

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

/**
 * 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 Integer && _map.containsKey( unwrapKey( key ) );
}

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

/**
 * 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 Integer && _map.containsKey( unwrapKey( key ) );
}

相关文章