java.util.ArrayList.replaceAll()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(257)

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

ArrayList.replaceAll介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

ArrayList<String> l = new ArrayList<>(Arrays.asList("AB","A","AA"));
l.replaceAll(x -> "b" + x);
System.out.println(l);

代码示例来源:origin: badoualy/kotlogram

@Override
public void replaceAll(UnaryOperator<T> operator) {
  items.replaceAll(operator);
}

代码示例来源:origin: stackoverflow.com

public static ArrayList<Double> multi(ArrayList<Double> coll1) {
   coll1.replaceAll(aDouble -> aDouble*2.0);
   return coll1;
 }

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

@Override
public void replaceAll(final UnaryOperator<E> operator)
{
  if (mReadOnlyFlag == true)
  {
    throw (
      new UnsupportedOperationException(
        "list is read-only"));
  }
  super.replaceAll(operator); //To change body of generated methods, choose Tools | Templates.
} // end of replaceAll(UnarayOperator)

代码示例来源:origin: jillesvangurp/jsonj

@Override
public void replaceAll(UnaryOperator<JsonElement> operator) {
  if(immutable) {
    throw new IllegalStateException("object is immutable");
  }
  super.replaceAll(operator);
}

代码示例来源:origin: com.daioware/collections

@Override
public void replaceAll(UnaryOperator<T> operator) {
  super.replaceAll(operator);
  afterReplaceAll();
}

代码示例来源:origin: PortSwigger/param-miner

private void removeBadEntries(ArrayList<String> params) {
    params.remove("");

    if (type == Utilities.PARAM_HEADER) {
      params.removeIf(x -> Character.isDigit(x.charAt(0)));
      params.replaceAll(String::toLowerCase);
    }
  }
}

代码示例来源:origin: woefe/ShoppingList

@Override
public void replaceAll(UnaryOperator<ListItem> operator) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    super.replaceAll(operator);
    notifyListChanged(Event.newOther());
  }
}

代码示例来源:origin: fastily/jwiki

/**
 * Gets duplicates of a file.
 * 
 * @param wiki The wiki object to use
 * @param localOnly Set to true if you only want to look for files in the local repository.
 * @param titles The titles to query
 * @return A list of results keyed by title.
 */
public static HashMap<String, ArrayList<String>> getDuplicatesOf(Wiki wiki, boolean localOnly, Collection<String> titles)
{
  HashMap<String, String> pl = new HashMap<>();
  if (localOnly)
    pl.put("dflocalonly", "");
  HashMap<String, ArrayList<String>> l = parsePropToSingle(getContProp(wiki, titles, WQuery.DUPLICATEFILES, pl, "duplicatefiles"),
      "name");
  l.forEach((k, v) -> v.replaceAll(s -> wiki.convertIfNotInNS(s.replace('_', ' '), NS.FILE)));
  return l;
}

代码示例来源:origin: PortSwigger/param-miner

params.replaceAll(x -> x.toLowerCase().replaceAll("[^a-z0-9_-]", ""));
  params.replaceAll(x -> x.replaceFirst("^[_-]+", ""));
  params.remove("");
params.replaceAll(x -> x.substring(0, min(x.length(), config.getInt("max param length"))));

相关文章