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

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

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

LinkedList.removeIf介绍

暂无

代码示例

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

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

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

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

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

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

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

  1. void unregister(Window window) {
  2. if (activeWindow == window) {
  3. activeWindow = null;
  4. }
  5. windowStack.removeIf(w -> w == window);
  6. activateLast();
  7. }

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

  1. public static LinkedList<Vertex5> simplifyModel(LinkedList<Vertex5> in) {
  2. LinkedList<Face> faces = new LinkedList<>();
  3. Iterator<Vertex5> iter = in.iterator();
  4. while (iter.hasNext()) {
  5. Face f = Face.loadFromIterator(iter);
  6. faces.removeIf(f::attemptToCombine);
  7. faces.add(f);
  8. }
  9. LinkedList<Vertex5> out = new LinkedList<>();
  10. for (Face f : faces) {
  11. Collections.addAll(out, f.verts);
  12. }
  13. return out;
  14. }

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

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

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

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

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

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

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

  1. private void cleanup() {
  2. assert(lock.isHeldByCurrentThread());
  3. if (!takes.isEmpty()) {
  4. takes.removeIf((Handler<Object> handler) -> !handler.isActive());
  5. }
  6. if (!puts.isEmpty()) {
  7. puts.removeIf((Putter putter) -> !putter.getHandler().isActive());
  8. }
  9. }

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

  1. public void mergeAction( @Nonnull final ChannelAction action )
  2. {
  3. /*
  4. * If we have an unfiltered inverse action in actions list then we can remove
  5. * that action and avoid adding this action. This avoids scenario where there
  6. * are multiple actions for the same address in ChangeSet.
  7. */
  8. if ( ChannelAction.Action.ADD == action.getAction() )
  9. {
  10. if ( _channelActions.removeIf( a -> ChannelAction.Action.REMOVE == a.getAction() &&
  11. a.getAddress().equals( action.getAddress() ) &&
  12. null == action.getFilter() ) )
  13. {
  14. return;
  15. }
  16. }
  17. else if ( ChannelAction.Action.REMOVE == action.getAction() )
  18. {
  19. if ( _channelActions.removeIf( a -> ChannelAction.Action.ADD == a.getAction() &&
  20. a.getAddress().equals( action.getAddress() ) &&
  21. null == a.getFilter() ) )
  22. {
  23. return;
  24. }
  25. }
  26. _channelActions.add( action );
  27. }

相关文章