Tabnine Logo
HashSet.removeIf
Code IndexAdd Tabnine to your IDE (free)

How to use
removeIf
method
in
java.util.HashSet

Best Java code snippets using java.util.HashSet.removeIf (Showing top 14 results out of 315)

origin: apache/accumulo

@Override
public void addSummarizers(String tableName, SummarizerConfiguration... newConfigs)
  throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
 HashSet<SummarizerConfiguration> currentConfigs = new HashSet<>(
   SummarizerConfiguration.fromTableProperties(getProperties(tableName)));
 HashSet<SummarizerConfiguration> newConfigSet = new HashSet<>(Arrays.asList(newConfigs));
 newConfigSet.removeIf(currentConfigs::contains);
 Set<String> newIds = newConfigSet.stream().map(SummarizerConfiguration::getPropertyId)
   .collect(toSet());
 for (SummarizerConfiguration csc : currentConfigs) {
  if (newIds.contains(csc.getPropertyId())) {
   throw new IllegalArgumentException("Summarizer property id is in use by " + csc);
  }
 }
 Set<Entry<String,String>> es = SummarizerConfiguration.toTableProperties(newConfigSet)
   .entrySet();
 for (Entry<String,String> entry : es) {
  setProperty(tableName, entry.getKey(), entry.getValue());
 }
}
origin: io.snamp/internal-services

@Override
public final boolean removeIf(final Predicate<? super E> filter) {
  final boolean removed = super.removeIf(filter);
  modified |= removed;
  return removed;
}
origin: net.fushizen.invokedynamic.proxy/invokedynamic-proxy

public void add(Method m) {
  if ((m.getModifiers() & Modifier.ABSTRACT) != 0) return;
  // Remove any concrete implementations that come from superclasses of the class that owns this new method
  // (this new class shadows them).
  contributors.removeIf(m2 -> m2.getDeclaringClass().isAssignableFrom(m.getDeclaringClass()));
  // Conversely, if this new implementation is shadowed by any existing implementations, we'll drop it instead
  if (contributors.stream().anyMatch(m2 -> m.getDeclaringClass().isAssignableFrom(m2.getDeclaringClass()))) {
    return;
  }
  contributors.add(m);
}
origin: com.premiumminds/pm-wicket-utils

private static Method[] initMethods() {
  HashSet<Method> aux = new HashSet<Method>(Arrays.asList(RequestTargetTester.class.getDeclaredMethods()));
  aux.remove(getMethodHelper("addListener", AjaxRequestTarget.IListener.class));
  aux.remove(getMethodHelper("respond", IRequestCycle.class));
  aux.remove(getMethodHelper("detach", IRequestCycle.class));
  aux.removeIf(m -> m.isSynthetic());
  return aux.toArray(new Method[aux.size()]);
}
origin: apache/jackrabbit-oak

@Override
public void writeRestrictions(String oakPath, Tree aceTree, Set<Restriction> restrictions) throws RepositoryException {
  Sets.newHashSet(restrictions).removeIf(r -> REP_NODE_PATH.equals(r.getDefinition().getName()));
  base.writeRestrictions(oakPath, aceTree, restrictions);
}
origin: org.apache.jackrabbit/oak-core

@Override
public void writeRestrictions(String oakPath, Tree aceTree, Set<Restriction> restrictions) throws RepositoryException {
  Sets.newHashSet(restrictions).removeIf(r -> REP_NODE_PATH.equals(r.getDefinition().getName()));
  base.writeRestrictions(oakPath, aceTree, restrictions);
}
origin: org.apereo.cas/cas-server-support-ldap

  /**
   * Initialize the handler, setup the authentication entry attributes.
   */
  public void initialize() {
    /*
     * Use a set to ensure we ignore duplicates.
     */
    val attributes = new HashSet<String>();
    LOGGER.debug("Initializing LDAP attribute configuration...");
    if (StringUtils.isNotBlank(this.principalIdAttribute)) {
      LOGGER.debug("Configured to retrieve principal id attribute [{}]", this.principalIdAttribute);
      attributes.add(this.principalIdAttribute);
    }
    if (this.principalAttributeMap != null && !this.principalAttributeMap.isEmpty()) {
      val attrs = this.principalAttributeMap.keySet();
      attributes.addAll(attrs);
      LOGGER.debug("Configured to retrieve principal attribute collection of [{}]", attrs);
    }
    if (authenticator.getReturnAttributes() != null) {
      val authenticatorAttributes = CollectionUtils.wrapList(authenticator.getReturnAttributes());
      if (!authenticatorAttributes.isEmpty()) {
        LOGGER.debug("Filtering authentication entry attributes [{}] based on authenticator attributes [{}]", authenticatedEntryAttributes, authenticatorAttributes);
        attributes.removeIf(authenticatorAttributes::contains);
      }
    }
    this.authenticatedEntryAttributes = attributes.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
    LOGGER.debug("LDAP authentication entry attributes for the authentication request are [{}]", (Object[]) this.authenticatedEntryAttributes);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

private void findTargettedModules(char[] prefix, HashSet<String> skipSet) {
  HashSet<String> probableModules = new HashSet<>();
  ModuleSourcePathManager mManager = JavaModelManager.getModulePathManager();
  JavaElementRequestor javaElementRequestor = new JavaElementRequestor();
  try {
    mManager.seekModule(this.completionToken, true, javaElementRequestor);
    IModuleDescription[] modules = javaElementRequestor.getModules();
    for (IModuleDescription module : modules) {
      String name = module.getElementName();
      if (name == null || name.equals("")) //$NON-NLS-1$
        continue;
      probableModules.add(name);
    }
  } catch (JavaModelException e) {
    // TODO ignore for now
  }
  probableModules.addAll(getAllJarModuleNames(this.javaProject));
  if (prefix != CharOperation.ALL_PREFIX && prefix != null && prefix.length > 0) {
    probableModules.removeIf(e -> isFailedMatch(prefix, e.toCharArray()));
  }
  for (String s : probableModules) {
    if (!skipSet.contains(s))
      this.acceptModule(s.toCharArray());
  }
}
private void findTargettedModules(CompletionOnModuleReference moduleReference, HashSet<String> skipSet) {
origin: io.github.factoryfx/javascript

reachableClasses.removeIf(this::isBuiltIn);
reachableClasses.removeIf(Class::isArray);
reachableClasses.removeIf(Class::isPrimitive);
reachableClasses.forEach(r->{
  if (!classesAlreadyDeclared.contains(r)) {
origin: girtel/Net2Plan

  public int getIndex(Graph<GUINode,GUILink> graph, GUILink e) 
  {
    final GUINode u = e.getOriginNode();
    final GUINode v = e.getDestinationNode();
    final HashSet<GUILink> commonEdgeSet = new HashSet<>(graph.getInEdges(v));
    commonEdgeSet.retainAll(graph.getOutEdges(u));
    commonEdgeSet.removeIf(ee->!ee.isShownSeparated());
    int count=0;
    for(GUILink other : commonEdgeSet) 
      if (other == e)
        return count;
      else
        count ++;
    throw new RuntimeException();
  }
});
origin: nats-io/java-nats

pureSubscribers.removeIf((s) -> {
  return s.getDispatcher() != null;
});
origin: io.nats/jnats

pureSubscribers.removeIf((s) -> {
  return s.getDispatcher() != null;
});
origin: TeamWizardry/Wizardry

@SubscribeEvent
public static void worldTick(TickEvent.WorldTickEvent event) {
  if (event.phase == TickEvent.Phase.START)
    reversals.removeIf((reversal) -> {
      if (reversal.world.get() == event.world) {
        if (reversal.nemez.hasNext()) {
          reversal.nemez.applySnapshot(event.world);
          if (reversal.pos != null && reversal.world.get().getTotalWorldTime() % PacketNemezReversal.SYNC_AMOUNT == 0)
            PacketHandler.NETWORK.sendToAllAround(new PacketNemezReversal(reversal.nemez),
                new NetworkRegistry.TargetPoint(reversal.world.get().provider.getDimension(),
                    reversal.pos.getX() + 0.5, reversal.pos.getY() + 0.5, reversal.pos.getZ() + 0.5, 96));
        } else {
          for (Entity entity : reversal.nemez.getTrackedEntities(event.world))
            entity.setNoGravity(false);
          return true;
        }
      }
      return reversal.world.get() == null;
    });
}
origin: de.mhus.lib/mhu-lib-core

public void doQueueCheck() {
  log().d("doQueueCheck");
  lastQueueCheck = System.currentTimeMillis();
  synchronized (running) {
    synchronized (jobs) {
      jobs.removeIf(j -> {
        return j.isCanceled();
      });
      jobs.forEach(j -> {
        if (!queue.contains(j) && !running.contains(j)) {
          try {
            log().w("reschedule lost job",j.getName());
            j.setNextExecutionTime(SchedulerJob.CALCULATE_NEXT);
            j.doSchedule(this);
          } catch (Throwable t) {
            log().w("reschedule failed",j,t);
          }
        }
      });
    }
  }
}

java.utilHashSetremoveIf

Popular methods of HashSet

  • <init>
  • add
    Adds the specified element to this set if it is not already present. More formally, adds the specifi
  • contains
    Returns true if this set contains the specified element. More formally, returns true if and only if
  • size
    Returns the number of elements in this set (its cardinality).
  • addAll
  • remove
    Removes the specified element from this set if it is present. More formally, removes an element e su
  • iterator
    Returns an iterator over the elements in this set. The elements are returned in no particular order.
  • isEmpty
    Returns true if this set contains no elements.
  • clear
    Removes all of the elements from this set. The set will be empty after this call returns.
  • toArray
  • removeAll
  • equals
  • removeAll,
  • equals,
  • clone,
  • retainAll,
  • stream,
  • containsAll,
  • forEach,
  • hashCode,
  • toString

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now