java.util.LinkedList.removeIf()方法的使用及代码示例

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

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

LinkedList.removeIf介绍

暂无

代码示例

代码示例来源:origin: speedment/speedment

@Override
public boolean removeIf(Predicate<? super Action<?, ?>> filter) {
  return list.removeIf(filter);
}

代码示例来源:origin: com.speedment.runtime/runtime-core

@Override
public boolean removeIf(Predicate<? super Action<?, ?>> filter) {
  return list.removeIf(filter);
}

代码示例来源:origin: de.mhus.lib/mhu-lib-core

public void cleanupWeak() {
  items.removeIf(i -> i.get() == null);
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

void unregister(Window window) {
 if (activeWindow == window) {
  activeWindow = null;
 }
 windowStack.removeIf(w -> w == window);
 activateLast();
}

代码示例来源:origin: CoFH/ThermalDynamics

public static LinkedList<Vertex5> simplifyModel(LinkedList<Vertex5> in) {
  LinkedList<Face> faces = new LinkedList<>();
  Iterator<Vertex5> iter = in.iterator();
  while (iter.hasNext()) {
    Face f = Face.loadFromIterator(iter);
    faces.removeIf(f::attemptToCombine);
    faces.add(f);
  }
  LinkedList<Vertex5> out = new LinkedList<>();
  for (Face f : faces) {
    Collections.addAll(out, f.verts);
  }
  return out;
}

代码示例来源:origin: com.wavefront/java-lib

private void clearPriorCurrentMinuteBin(long cutoffMillis) {
 if (perThreadHistogramBins == null) {
  // will happen if WavefrontHistogram.super() constructor will be invoked
  // before WavefrontHistogram object is fully instantiated,
  // which will be invoke clear() method
  return;
 }
 for (LinkedList<MinuteBin> bins : perThreadHistogramBins.values()) {
  // getCurrent() method will add (PRODUCER) item to the bins list, so synchronize the access
  synchronized (bins) {
   bins.removeIf(minuteBin -> minuteBin.getMinMillis() < cutoffMillis);
  }
 }
}

代码示例来源:origin: wavefrontHQ/java

private void clearPriorCurrentMinuteBin(long cutoffMillis) {
 if (perThreadHistogramBins == null) {
  // will happen if WavefrontHistogram.super() constructor will be invoked
  // before WavefrontHistogram object is fully instantiated,
  // which will be invoke clear() method
  return;
 }
 for (LinkedList<MinuteBin> bins : perThreadHistogramBins.values()) {
  // getCurrent() method will add (PRODUCER) item to the bins list, so synchronize the access
  synchronized (bins) {
   bins.removeIf(minuteBin -> minuteBin.getMinMillis() < cutoffMillis);
  }
 }
}

代码示例来源:origin: io.swagger.codegen.v3/swagger-codegen-generators

/**
 *  Split the path as a string to a list of strings to map to the path directives of akka http
 *  @see <a href="https://doc.akka.io/docs/akka-http/current/routing-dsl/directives/path-directives/index.html">Akka Http Documentation</a>
 */
protected static void addPathMatcher(CodegenOperation codegenOperation) {
  LinkedList<String> allPaths = new LinkedList<>(Arrays.asList(codegenOperation.path.split("/")));
  allPaths.removeIf(""::equals);
  LinkedList<TextOrMatcher> paths = replacePathsWithMatchers(allPaths, codegenOperation);
  codegenOperation.getVendorExtensions().put(PATHS, paths);
}

代码示例来源:origin: io.github.matzoliv/async-channels-core

private void cleanup() {
  assert(lock.isHeldByCurrentThread());
  if (!takes.isEmpty()) {
    takes.removeIf((Handler<Object> handler) -> !handler.isActive());
  }
  if (!puts.isEmpty()) {
    puts.removeIf((Putter putter) -> !putter.getHandler().isActive());
  }
}

代码示例来源:origin: org.realityforge.replicant/replicant-server

public void mergeAction( @Nonnull final ChannelAction action )
{
 /*
  * If we have an unfiltered inverse action in actions list then we can remove
  * that action and avoid adding this action. This avoids scenario where there
  * are multiple actions for the same address in ChangeSet.
  */
 if ( ChannelAction.Action.ADD == action.getAction() )
 {
  if ( _channelActions.removeIf( a -> ChannelAction.Action.REMOVE == a.getAction() &&
                    a.getAddress().equals( action.getAddress() ) &&
                    null == action.getFilter() ) )
  {
   return;
  }
 }
 else if ( ChannelAction.Action.REMOVE == action.getAction() )
 {
  if ( _channelActions.removeIf( a -> ChannelAction.Action.ADD == a.getAction() &&
                    a.getAddress().equals( action.getAddress() ) &&
                    null == a.getFilter() ) )
  {
   return;
  }
 }
 _channelActions.add( action );
}

相关文章

微信公众号

最新文章

更多