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

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

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

TIntIntMap.containsKey介绍

[英]Checks for the present of key in the keys of the map.
[中]检查地图的键中是否存在键。

代码示例

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

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

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

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

代码示例来源: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: CalebFenton/simplify

@Override
public void execute(ExecutionNode node, MethodState mState) {
  // Pseudo points to instruction *after* switch op.
  MethodLocation returnLocation = mState.getPseudoInstructionReturnInstruction();
  int branchFromAddress = returnLocation.getCodeAddress() - SWITCH_OP_CODE_UNITS;
  HeapItem targetItem = mState.readResultRegister();
  if (targetItem.isUnknown()) {
    List<MethodLocation> childList = getTargets(branchFromAddress, targetKeyToOffset);
    childList.add(returnLocation);
    MethodLocation[] children = childList.toArray(new MethodLocation[childList.size()]);
    node.setChildLocations(children);
    return;
  }
  int targetKey = Utils.getIntegerValue(targetItem.getValue());
  if (targetKeyToOffset.containsKey(targetKey)) {
    int targetOffset = branchFromAddress + targetKeyToOffset.get(targetKey);
    MethodLocation child = addressToLocation.get(targetOffset);
    node.setChildLocations(child);
    return;
  }
  // Branch target is unspecified. Continue to next op.
  node.setChildLocations(returnLocation);
}

代码示例来源:origin: opentripplanner/OpenTripPlanner

if (!out.containsKey(s.index) || out.get(s.index) > time)
    out.put(s.index, time);
  LOG.warn("Transit stop not found for transfer rule with stop label {}", tr.stop);
if (!indexForStop.containsKey(tstop.getIndex()))

代码示例来源:origin: guokr/simbase

@Override
public boolean contains(int vecid) {
  return this.indexer.containsKey(vecid);
}

代码示例来源:origin: zavtech/morpheus-core

@Override
public final boolean contains(Integer key) {
  return indexMap.containsKey(key);
}

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

@Override
public boolean containsKey(Object key) {
  return map.containsKey(((Number)key).intValue());
}

代码示例来源: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: zavtech/morpheus-core

@Override
public final boolean contains(T key) {
  final int code = coding.getCode(key);
  return indexMap.containsKey(code);
}

代码示例来源:origin: shilad/wikibrain

public float[] getVector(int id) {
  if (sparse2Dense.containsKey(id)) {
    return matrix[sparse2Dense.get(id)];
  } else {
    return null;
  }
}

代码示例来源: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: shilad/wikibrain

public float similarity(int id1, int id2) {
  if (sparse2Dense.containsKey(id1) && sparse2Dense.containsKey(id2)) {
    return matrix[sparse2Dense.get(id1)][sparse2Dense.get(id2)];
  } else {
    return 0f;
  }
}

代码示例来源: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: guokr/simbase

@Override
public float[] get(int vecid) {
  float[] result;
  if (indexer.containsKey(vecid)) {
    result = new float[this.base.size()];
    get(vecid, result);
  } else {
    result = new float[0];
  }
  return result;
}

代码示例来源:origin: org.wikibrainapi/wikibrain-matrix

@Override
public InMemorySparseMatrixRow getRow(int rowId) throws IOException {
  if (rowMap.containsKey(rowId)) {
    return getMatrixRowInternal(rowMap.get(rowId));
  } else {
    return null;
  }
}

代码示例来源:origin: shilad/wikibrain

@Override
public InMemorySparseMatrixRow getRow(int rowId) throws IOException {
  if (rowMap.containsKey(rowId)) {
    return getMatrixRowInternal(rowMap.get(rowId));
  } else {
    return null;
  }
}

代码示例来源:origin: guokr/simbase

@Override
public void remove(int vecid) {
  if (indexer.containsKey(vecid)) {
    indexer.remove(vecid);
    lengths.remove(vecid);
    if (listening) {
      for (VectorSetListener l : listeners) {
        l.onVectorRemoved(this, vecid);
      }
    }
  }
}

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

public boolean add(int item) {
  if (idx.containsKey(item)) {
    return false;
  }
  idx.put(item, dta.size());
  dta.add(item);
  return true;
}

代码示例来源:origin: guokr/simbase

@Override
public void remove(int vecid) {
  if (indexer.containsKey(vecid)) {
    indexer.remove(vecid);
    lengths.remove(vecid);
    if (listening) {
      for (VectorSetListener l : listeners) {
        l.onVectorRemoved(this, vecid);
      }
    }
  }
}

相关文章