org.eclipse.collections.api.map.MutableMap.updateValue()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(94)

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

MutableMap.updateValue介绍

暂无

代码示例

代码示例来源:origin: eclipse/eclipse-collections

@Override
public void value(T each)
{
  this.map.updateValue(this.groupBy.valueOf(each), Functions0.zeroBigInteger(), original -> original.add(this.function.valueOf(each)));
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigDecimal> sumByBigDecimal(
    Iterator<T> iterator,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigDecimal> function)
{
  MutableMap<V, BigDecimal> result = UnifiedMap.newMap();
  while (iterator.hasNext())
  {
    T item = iterator.next();
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigDecimal(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(
    Iterator<T> iterator,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigInteger> function)
{
  MutableMap<V, BigInteger> result = UnifiedMap.newMap();
  while (iterator.hasNext())
  {
    T item = iterator.next();
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigInteger(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(
    Iterator<T> iterator,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigInteger> function)
{
  MutableMap<V, BigInteger> result = UnifiedMap.newMap();
  while (iterator.hasNext())
  {
    T item = iterator.next();
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigInteger(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public void value(T each)
{
  this.map.updateValue(this.groupBy.valueOf(each), Functions0.zeroBigDecimal(), original -> original.add(this.function.valueOf(each)));
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigDecimal> sumByBigDecimal(
    Iterator<T> iterator,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigDecimal> function)
{
  MutableMap<V, BigDecimal> result = UnifiedMap.newMap();
  while (iterator.hasNext())
  {
    T item = iterator.next();
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigDecimal(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public void value(T each)
{
  this.map.updateValue(this.groupBy.valueOf(each), Functions0.zeroBigInteger(), original -> original.add(this.function.valueOf(each)));
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
public void value(T each)
{
  this.map.updateValue(this.groupBy.valueOf(each), Functions0.zeroBigDecimal(), original -> original.add(this.function.valueOf(each)));
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(
    List<T> list,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigInteger> function)
{
  MutableMap<V, BigInteger> result = UnifiedMap.newMap();
  int size = list.size();
  for (int i = 0; i < size; i++)
  {
    T item = list.get(i);
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigInteger(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigDecimal> sumByBigDecimal(
    List<T> list,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigDecimal> function)
{
  MutableMap<V, BigDecimal> result = UnifiedMap.newMap();
  int size = list.size();
  for (int i = 0; i < size; i++)
  {
    T item = list.get(i);
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigDecimal(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(
    List<T> list,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigInteger> function)
{
  MutableMap<V, BigInteger> result = UnifiedMap.newMap();
  int size = list.size();
  for (int i = 0; i < size; i++)
  {
    T item = list.get(i);
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigInteger(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

public static <V, T> MutableMap<V, BigDecimal> sumByBigDecimal(
    List<T> list,
    Function<? super T, ? extends V> groupBy,
    Function<? super T, BigDecimal> function)
{
  MutableMap<V, BigDecimal> result = UnifiedMap.newMap();
  int size = list.size();
  for (int i = 0; i < size; i++)
  {
    T item = list.get(i);
    result.updateValue(groupBy.valueOf(item), Functions0.zeroBigDecimal(), original -> original.add(function.valueOf(item)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

/**
 * @see Iterate#sumByBigDecimal(Iterable, Function, Function)
 * @since 6.0
 */
public static <V, T> MutableMap<V, BigDecimal> sumByBigDecimal(T[] array, Function<? super T, ? extends V> groupBy, Function<? super T, BigDecimal> function)
{
  MutableMap<V, BigDecimal> result = UnifiedMap.newMap();
  for (T each : array)
  {
    result.updateValue(groupBy.valueOf(each), Functions0.zeroBigDecimal(), original -> original.add(function.valueOf(each)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

/**
 * @see Iterate#sumByBigInteger(Iterable, Function, Function)
 * @since 6.0
 */
public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(T[] array, Function<? super T, ? extends V> groupBy, Function<? super T, BigInteger> function)
{
  MutableMap<V, BigInteger> result = UnifiedMap.newMap();
  for (T each : array)
  {
    result.updateValue(groupBy.valueOf(each), Functions0.zeroBigInteger(), original -> original.add(function.valueOf(each)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

/**
 * @see Iterate#sumByBigInteger(Iterable, Function, Function)
 * @since 6.0
 */
public static <V, T> MutableMap<V, BigInteger> sumByBigInteger(T[] array, Function<? super T, ? extends V> groupBy, Function<? super T, BigInteger> function)
{
  MutableMap<V, BigInteger> result = UnifiedMap.newMap();
  for (T each : array)
  {
    result.updateValue(groupBy.valueOf(each), Functions0.zeroBigInteger(), original -> original.add(function.valueOf(each)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

/**
 * @see Iterate#sumByBigDecimal(Iterable, Function, Function)
 * @since 6.0
 */
public static <V, T> MutableMap<V, BigDecimal> sumByBigDecimal(T[] array, Function<? super T, ? extends V> groupBy, Function<? super T, BigDecimal> function)
{
  MutableMap<V, BigDecimal> result = UnifiedMap.newMap();
  for (T each : array)
  {
    result.updateValue(groupBy.valueOf(each), Functions0.zeroBigDecimal(), original -> original.add(function.valueOf(each)));
  }
  return result;
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
  public void combineOne(SumByBigDecimalProcedure<T, V> thingToCombine)
  {
    if (this.result.isEmpty())
    {
      this.result.putAll(thingToCombine.getResult());
    }
    else
    {
      thingToCombine.getResult().forEachKeyValue((key, value) -> this.result.updateValue(key, Functions0.zeroBigDecimal(), original -> original.add(value)));
    }
  }
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
  public void combineOne(SumByBigIntegerProcedure<T, V> thingToCombine)
  {
    if (this.result.isEmpty())
    {
      this.result.putAll(thingToCombine.getResult());
    }
    else
    {
      thingToCombine.getResult().forEachKeyValue((key, value) -> this.result.updateValue(key, Functions0.zeroBigInteger(), original -> original.add(value)));
    }
  }
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
  public void combineOne(SumByBigDecimalProcedure<T, V> thingToCombine)
  {
    if (this.result.isEmpty())
    {
      this.result.putAll(thingToCombine.getResult());
    }
    else
    {
      thingToCombine.getResult().forEachKeyValue((key, value) -> this.result.updateValue(key, Functions0.zeroBigDecimal(), original -> original.add(value)));
    }
  }
}

代码示例来源:origin: eclipse/eclipse-collections

@Override
  public void combineOne(SumByBigIntegerProcedure<T, V> thingToCombine)
  {
    if (this.result.isEmpty())
    {
      this.result.putAll(thingToCombine.getResult());
    }
    else
    {
      thingToCombine.getResult().forEachKeyValue((key, value) -> this.result.updateValue(key, Functions0.zeroBigInteger(), original -> original.add(value)));
    }
  }
}

相关文章

MutableMap类方法