java.util.TreeMap.putIfAbsent()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(202)

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

TreeMap.putIfAbsent介绍

暂无

代码示例

代码示例来源:origin: apache/hive

cdIds.putIfAbsent(ids[CD_INDEX], new ArrayList<>(5));
if (part.getSd().getCols() == null) {
 part.getSd().setCols(cdIds.get(ids[CD_INDEX]));

代码示例来源:origin: justlive1/oxygen

@Override
public V putIfAbsent(K key, V value) {
 ExpiringValue<V> wrapValue = new ExpiringValue<>(value);
 ExpiringValue<V> preVal = data.putIfAbsent(key, wrapValue);
 if (preVal == null || preVal.expireAt < System.currentTimeMillis()) {
  return null;
 }
 return preVal.value;
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

@Override
public void addProperty(Property prop) {
  if(attributeMappings == null){
    attributeMappings = new TreeMap<>(  );
  }
  if ( declaredAttributeMappings == null ) {
    declaredAttributeMappings = new TreeMap<>(  );
  }
  attributeMappings.putIfAbsent( prop.getName(), prop );
  declaredAttributeMappings.putIfAbsent( prop.getName(), prop );
  prop.setPersistentClass( getPersistentClass() );
}

代码示例来源:origin: io.scalecube/config

String name = i.getPropName();
String value = i.getPropValue();
map.putIfAbsent(
  name,
  LoadedConfigProperty.withNameAndValue(name, value).origin(origin).build());

代码示例来源:origin: io.sarl/io.sarl.util

final Class<?>[] parameterTypes = method.getParameterTypes();
final BehaviorGuardEvaluatorRegistry.MethodIdentifier ident = new BehaviorGuardEvaluatorRegistry.MethodIdentifier(method, parameterTypes);
identifiers.putIfAbsent(ident, method);

代码示例来源:origin: SmartDataAnalytics/DL-Learner

subsumptionHierarchyDown.putIfAbsent(sub, new TreeSet<>());
subsumptionHierarchyUp.putIfAbsent(sub, new TreeSet<>());
  subsumptionHierarchyDown.putIfAbsent(sup, new TreeSet<>());
  subsumptionHierarchyUp.putIfAbsent(sup, new TreeSet<>());

代码示例来源:origin: SmartDataAnalytics/DL-Learner

subsumptionHierarchyDown.putIfAbsent(sub, new TreeSet<>());
subsumptionHierarchyUp.putIfAbsent(sub, new TreeSet<>());
  subsumptionHierarchyDown.putIfAbsent(sup, new TreeSet<>());
  subsumptionHierarchyUp.putIfAbsent(sup, new TreeSet<>());

代码示例来源:origin: org.uberfire/uberfire-metadata-backend-infinispan

Optional.ofNullable(descriptor.findFieldByName(toProtobufFormat(kprop.getName())))
    .ifPresent(field -> props
        .putIfAbsent(field.getNumber(),
               kprop)));

代码示例来源:origin: kiegroup/appformer

Optional.ofNullable(descriptor.findFieldByName(toProtobufFormat(kprop.getName())))
    .ifPresent(field -> props
        .putIfAbsent(field.getNumber(),
               kprop)));

相关文章