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

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

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

TIntIntMap.putIfAbsent介绍

[英]Inserts a key/value pair into the map if the specified key is not already associated with a value.
[中]如果指定的键尚未与值关联,则在映射中插入键/值对。

代码示例

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

public int putIfAbsent( int key, int value ) {
  synchronized( mutex ) { return m.putIfAbsent( key, value ); }
}
public boolean forEachKey( TIntProcedure procedure ) {

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

public int putIfAbsent( int key, int value ) {
  synchronized( mutex ) { return m.putIfAbsent( key, value ); }
}
public boolean forEachKey( TIntProcedure procedure ) {

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

public int putIfAbsent( int key, int value ) {
  synchronized( mutex ) { return m.putIfAbsent( key, value ); }
}
public boolean forEachKey( TIntProcedure procedure ) {

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

@Override
public int putIfAbsent( int key, int value ) {
  synchronized( mutex ) { return m.putIfAbsent( key, value ); }
}
@Override

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

public int putIfAbsent( int key, int value ) {
  synchronized( mutex ) { return m.putIfAbsent( key, value ); }
}
public boolean forEachKey( TIntProcedure procedure ) {

代码示例来源:origin: com.johnsnowlabs.nlp/spark-nlp

public int lookupIndex(DictionaryTypes tag, String item)
{
  int id = dictionaries[tag.ordinal()].lookupIndex(item);
  if (isCounting && id > 0) {
    counters[tag.ordinal()].putIfAbsent(id, 0);
    counters[tag.ordinal()].increment(id);
  }
  return id <= 0 ? 1 : id;
}

代码示例来源:origin: com.johnsnowlabs/spark-nlp

public int lookupIndex(DictionaryTypes tag, String item)
{
  int id = dictionaries[tag.ordinal()].lookupIndex(item);
  if (isCounting && id > 0) {
    counters[tag.ordinal()].putIfAbsent(id, 0);
    counters[tag.ordinal()].increment(id);
  }
  return id <= 0 ? 1 : id;
}

相关文章