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

How to use
removeAll
method
in
java.util.HashSet

Best Java code snippets using java.util.HashSet.removeAll (Showing top 20 results out of 2,925)

origin: Netflix/eureka

/**
 * @return true if both list are the same, possibly in a different order
 */
public static <T extends EurekaEndpoint> boolean identical(List<T> firstList, List<T> secondList) {
  if (firstList.size() != secondList.size()) {
    return false;
  }
  HashSet<T> compareSet = new HashSet<>(firstList);
  compareSet.removeAll(secondList);
  return compareSet.isEmpty();
}
origin: twosigma/beakerx

private HashSet<String> getColumnsWithoutData(Set<String> dataColumnsNames) {
 final HashSet<String> columnsCopy = new HashSet<>(columns);
 columnsCopy.removeAll(dataColumnsNames);
 return columnsCopy;
}
origin: spotbugs/spotbugs

/**
 * Get Set of pass members which haven't been assigned a position in the
 * pass.
 */
public Set<DetectorFactory> getUnpositionedMembers() {
  HashSet<DetectorFactory> result = new HashSet<>(memberSet);
  result.removeAll(orderedFactoryList);
  return result;
}
origin: org.mockito/mockito-core

public boolean removeAll(Collection<?> mocks) {
  return backingHashSet.removeAll(asWrappedMocks(mocks));
}
origin: apache/incubator-druid

 @Override
 public void nodesRemoved(Collection<DiscoveryDruidNode> nodes)
 {
  coordNodes.removeAll(nodes);
 }
}
origin: apache/incubator-druid

 @Override
 public void nodesRemoved(Collection<DiscoveryDruidNode> nodes)
 {
  overlordNodes.removeAll(nodes);
 }
}
origin: apache/flink

/**
 * Merges two {@link ParameterTool}.
 *
 * @param other Other {@link ParameterTool} object
 * @return The Merged {@link ParameterTool}
 */
public ParameterTool mergeWith(ParameterTool other) {
  final Map<String, String> resultData = new HashMap<>(data.size() + other.data.size());
  resultData.putAll(data);
  resultData.putAll(other.data);
  final ParameterTool ret = new ParameterTool(resultData);
  final HashSet<String> requestedParametersLeft = new HashSet<>(data.keySet());
  requestedParametersLeft.removeAll(unrequestedParameters);
  final HashSet<String> requestedParametersRight = new HashSet<>(other.data.keySet());
  requestedParametersRight.removeAll(other.unrequestedParameters);
  ret.unrequestedParameters.removeAll(requestedParametersLeft);
  ret.unrequestedParameters.removeAll(requestedParametersRight);
  return ret;
}
origin: google/j2objc

public boolean removeAll(Collection<?> mocks) {
  return backingHashSet.removeAll(asWrappedMocks(mocks));
}
origin: apache/pulsar

public static List<String> topicsListsMinus(List<String> list1, List<String> list2) {
  HashSet<String> s1 = new HashSet<>(list1);
  s1.removeAll(list2);
  return s1.stream().collect(Collectors.toList());
}
origin: fesh0r/fernflower

public static boolean equalSets(Collection<?> c1, Collection<?> c2) {
 if (c1 == null) {
  return c2 == null;
 }
 else if (c2 == null) {
  return false;
 }
 if (c1.size() != c2.size()) {
  return false;
 }
 HashSet<Object> set = new HashSet<>(c1);
 set.removeAll(c2);
 return (set.size() == 0);
}
origin: spotbugs/spotbugs

  @ExpectWarning("GC_UNRELATED_TYPES")
  public boolean test2(HashSet<Integer> s1, HashSet<String> s2) {
    return s1.removeAll(s2);
  }
}
origin: spotbugs/spotbugs

@Override
public void report() {
  emptyArray.removeAll(nonEmptyArray);
  for (XField f : emptyArray) {
    xFactory.addEmptyArrayField(f);
  }
  emptyArray.clear();
}
origin: apache/usergrid

/**
 * Remove the names from the additions and deletions
 */
public void clear( final Set<String> names ) {
  this.deletions.removeAll( names );
  clearAdditions( names );
}
origin: gocd/gocd

private void notifyListenersOfRemovedPlugins(Set<PluginFileDetails> currentPluginFiles, Set<PluginFileDetails> previouslyKnownPluginFiles) {
  HashSet<PluginFileDetails> previouslyKnownPlugins = new HashSet<>(previouslyKnownPluginFiles);
  previouslyKnownPlugins.removeAll(currentPluginFiles);
  for (PluginFileDetails removedPluginFile : previouslyKnownPlugins) {
    doOnAllListeners().pluginJarRemoved(removedPluginFile);
  }
}
origin: gocd/gocd

private void notifyListenersOfAddedPlugins(Set<PluginFileDetails> currentPluginFiles, Set<PluginFileDetails> previouslyKnownPluginFiles) {
  HashSet<PluginFileDetails> currentPlugins = new HashSet<>(currentPluginFiles);
  currentPlugins.removeAll(previouslyKnownPluginFiles);
  for (PluginFileDetails newlyAddedPluginFile : currentPlugins) {
    doOnAllListeners().pluginJarAdded(newlyAddedPluginFile);
  }
}
origin: apache/kylin

private static Set<TblColRef> unmatchedDimensions(Collection<TblColRef> dimensionColumns, CubeInstance cube) {
  HashSet<TblColRef> result = Sets.newHashSet(dimensionColumns);
  CubeDesc cubeDesc = cube.getDescriptor();
  result.removeAll(cubeDesc.listDimensionColumnsIncludingDerived());
  return result;
}
origin: apache/ignite

/** {@inheritDoc} */
@Nullable @Override public Map<PartitionHashRecord, List<PartitionEntryHashRecord>> reduce(List<ComputeJobResult> results)
  throws IgniteException {
  Map<PartitionHashRecord, List<PartitionEntryHashRecord>> totalRes = new HashMap<>();
  for (ComputeJobResult res : results) {
    Map<PartitionHashRecord, List<PartitionEntryHashRecord>> nodeRes = res.getData();
    totalRes.putAll(nodeRes);
  }
  Set<PartitionEntryHashRecord> commonEntries = null;
  for (List<PartitionEntryHashRecord> nodeEntryHashRecords : totalRes.values()) {
    HashSet<PartitionEntryHashRecord> set = new HashSet<>(nodeEntryHashRecords);
    if (commonEntries == null)
      commonEntries = set;
    else
      commonEntries.retainAll(set);
  }
  if (commonEntries == null)
    return Collections.emptyMap();
  Map<PartitionHashRecord, List<PartitionEntryHashRecord>> conflictsRes = new HashMap<>();
  for (Map.Entry<PartitionHashRecord, List<PartitionEntryHashRecord>> e : totalRes.entrySet()) {
    HashSet<PartitionEntryHashRecord> conflicts = new HashSet<>(e.getValue());
    conflicts.removeAll(commonEntries);
    if (!conflicts.isEmpty())
      conflictsRes.put(e.getKey(), new ArrayList<>(conflicts));
  }
  return conflictsRes;
}
origin: apache/storm

notFound.removeAll(allExtractors.keySet());
if (notFound.size() > 0) {
  throw new IllegalArgumentException(notFound + " columns are not supported");
origin: fesh0r/fernflower

public static void removeDeadBlocks(ControlFlowGraph graph) {
 LinkedList<BasicBlock> stack = new LinkedList<>();
 HashSet<BasicBlock> setStacked = new HashSet<>();
 stack.add(graph.getFirst());
 setStacked.add(graph.getFirst());
 while (!stack.isEmpty()) {
  BasicBlock block = stack.removeFirst();
  List<BasicBlock> lstSuccs = new ArrayList<>(block.getSuccs());
  lstSuccs.addAll(block.getSuccExceptions());
  for (BasicBlock succ : lstSuccs) {
   if (!setStacked.contains(succ)) {
    stack.add(succ);
    setStacked.add(succ);
   }
  }
 }
 HashSet<BasicBlock> setAllBlocks = new HashSet<>(graph.getBlocks());
 setAllBlocks.removeAll(setStacked);
 for (BasicBlock block : setAllBlocks) {
  graph.removeBlock(block);
 }
}
origin: OpenHFT/Chronicle-Queue

  private String buildDiffs() {
    final StringBuilder builder = new StringBuilder();
    builder.append("acquired but not released:\n");
    HashSet<String> keyDiff = new HashSet<>(acquiredCounts.keySet());
    keyDiff.removeAll(releasedCounts.keySet());
    keyDiff.forEach(k -> {
      builder.append(k).append("(").append(acquiredCounts.get(k)).append(")\n");
    });
    builder.append("released but not acquired:\n");
    keyDiff.clear();
    keyDiff.addAll(releasedCounts.keySet());
    keyDiff.removeAll(acquiredCounts.keySet());
    keyDiff.forEach(k -> {
      builder.append(k).append("(").append(releasedCounts.get(k)).append(")\n");
    });
    return builder.toString();
  }
}
java.utilHashSetremoveAll

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
  • equals
  • clone
    Returns a shallow copy of this HashSet instance: the elements themselves are not cloned.
  • equals,
  • clone,
  • retainAll,
  • stream,
  • containsAll,
  • forEach,
  • hashCode,
  • toString,
  • removeIf

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 Sublime Text plugins
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