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

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

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

TIntIntMap.containsValue介绍

[英]Checks for the presence of val in the values of the map.
[中]检查映射值中是否存在val。

代码示例

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

public boolean containsValue( int value ){
  synchronized( mutex ) { return m.containsValue( value ); }
}
public int get( int key ) {

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

public boolean containsValue( int val ) { return m.containsValue( val ); }
public int get( int key)                { return m.get( key ); }

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

/**
 * Checks for the presence of <tt>val</tt> in the values of the map.
 *
 * @param val an <code>Object</code> value
 * @return a <code>boolean</code> value
 */
public boolean containsValue( Object val ) {
  return val instanceof Integer && _map.containsValue( unwrapValue( val ) );
}

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

@Override
public boolean containsValue( int value ){
  synchronized( mutex ) { return m.containsValue( value ); }
}
@Override

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

public boolean containsValue( int value ){
  synchronized( mutex ) { return m.containsValue( value ); }
}
public int get( int key ) {

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

public boolean containsValue( int value ){
  synchronized( mutex ) { return m.containsValue( value ); }
}
public int get( int key ) {

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

public boolean containsValue( int val ) { return m.containsValue( val ); }
public int get( int key)                { return m.get( key ); }

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

public boolean containsValue( int value ){
  synchronized( mutex ) { return m.containsValue( value ); }
}
public int get( int key ) {

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

@Override
public boolean containsValue( int val ) { return m.containsValue( val ); }
@Override

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

public boolean containsValue( int val ) { return m.containsValue( val ); }
public int get( int key)                { return m.get( key ); }

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

public boolean containsValue( int val ) { return m.containsValue( val ); }
public int get( int key)                { return m.get( key ); }

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

/**
 * Checks for the presence of <tt>val</tt> in the values of the map.
 *
 * @param val an <code>Object</code> value
 * @return a <code>boolean</code> value
 */
public boolean containsValue( Object val ) {
  return val instanceof Integer && _map.containsValue( unwrapValue( val ) );
}

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

/**
 * Checks for the presence of <tt>val</tt> in the values of the map.
 *
 * @param val an <code>Object</code> value
 * @return a <code>boolean</code> value
 */
public boolean containsValue( Object val ) {
  return val instanceof Integer && _map.containsValue( unwrapValue( val ) );
}

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

/**
 * Checks for the presence of <tt>val</tt> in the values of the map.
 *
 * @param val an <code>Object</code> value
 * @return a <code>boolean</code> value
 */
public boolean containsValue( Object val ) {
  return val instanceof Integer && _map.containsValue( unwrapValue( val ) );
}

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

/**
 * Checks for the presence of <tt>val</tt> in the values of the map.
 *
 * @param val an <code>Object</code> value
 * @return a <code>boolean</code> value
 */
@Override
public boolean containsValue( Object val ) {
  return val instanceof Integer && _map.containsValue( unwrapValue( val ) );
}

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

/**
 * Filter down a map from target stop indexes to distances so it only includes those stops that are the
 * closest on some pattern. This is technically incorrect (think of transfers to a U shaped metro from a bus line
 * running across the legs of the U, a situation which actually exists in Washington, DC with the
 * red line and the Q4) but anecdotally it speeds up computation by up to 40 percent. We may want to look into
 * other ways to optimize transfers (or why the transfers are making routing so much slower) if this turns out to
 * affect results.
 */
private void retainClosestStopsOnPatterns(TIntIntMap timesToReachedStops) {
  TIntIntMap bestStopOnPattern = new TIntIntHashMap(50, 0.5f, -1, -1);
  // For every reached stop,
  timesToReachedStops.forEachEntry((stopIndex, distanceToStop) -> {
    // For every pattern passing through that stop,
    transitLayer.patternsForStop.get(stopIndex).forEach(patternIndex -> {
      int currentBestStop = bestStopOnPattern.get(patternIndex);
      // Record this stop if it's the closest one yet seen on that pattern.
      if (currentBestStop == -1) {
        bestStopOnPattern.put(patternIndex, stopIndex);
      } else {
        int currentBestTime = timesToReachedStops.get(currentBestStop);
        if (currentBestTime > distanceToStop) {
          bestStopOnPattern.put(patternIndex, stopIndex);
        }
      }
      return true; // iteration should continue
    });
    return true; // iteration should continue
  });
  timesToReachedStops.retainEntries((stop, distance) -> bestStopOnPattern.containsValue(stop));
}

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

/**
 * Filter down a map from target stop indexes to distances so it only includes those stops that are the
 * closest on some pattern. This is technically incorrect (think of transfers to a U shaped metro from a bus line
 * running across the legs of the U, a situation which actually exists in Washington, DC with the
 * red line and the Q4) but anecdotally it speeds up computation by up to 40 percent. We may want to look into
 * other ways to optimize transfers (or why the transfers are making routing so much slower) if this turns out to
 * affect results.
 */
private void retainClosestStopsOnPatterns(TIntIntMap timesToReachedStops) {
  TIntIntMap bestStopOnPattern = new TIntIntHashMap(50, 0.5f, -1, -1);
  // For every reached stop,
  timesToReachedStops.forEachEntry((stopIndex, distanceToStop) -> {
    // For every pattern passing through that stop,
    transitLayer.patternsForStop.get(stopIndex).forEach(patternIndex -> {
      int currentBestStop = bestStopOnPattern.get(patternIndex);
      // Record this stop if it's the closest one yet seen on that pattern.
      if (currentBestStop == -1) {
        bestStopOnPattern.put(patternIndex, stopIndex);
      } else {
        int currentBestTime = timesToReachedStops.get(currentBestStop);
        if (currentBestTime > distanceToStop) {
          bestStopOnPattern.put(patternIndex, stopIndex);
        }
      }
      return true; // iteration should continue
    });
    return true; // iteration should continue
  });
  timesToReachedStops.retainEntries((stop, distance) -> bestStopOnPattern.containsValue(stop));
}

相关文章