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

How to use
retainAll
method
in
java.util.HashSet

Best Java code snippets using java.util.HashSet.retainAll (Showing top 20 results out of 1,089)

origin: org.mockito/mockito-core

public boolean retainAll(Collection<?> mocks) {
  return backingHashSet.retainAll(asWrappedMocks(mocks));
}
origin: google/j2objc

public boolean retainAll(Collection<?> mocks) {
  return backingHashSet.retainAll(asWrappedMocks(mocks));
}
origin: Sable/soot

/**
 * @ast method 
 * @aspect GenericMethodsInference
 * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:668
 */
public static HashSet EC(ArrayList list) {
  HashSet result = new HashSet();
  boolean first = true;
  for(Iterator iter = list.iterator(); iter.hasNext(); ) {
   TypeDecl U = (TypeDecl)iter.next();
   // erased supertype set of U
   HashSet EST = LUBType.EST(U); 
   if(first) {
    result.addAll(EST);
    first = false;
   }
   else
    result.retainAll(EST);
  }
  return result;
 }
/**
origin: commonsguy/cw-omnibus

intersection.retainAll(previous.apps.keySet());
origin: fesh0r/fernflower

private void splitJsrExceptionRanges(Set<BasicBlock> common_blocks, Map<Integer, BasicBlock> mapNewNodes) {
 for (int i = exceptions.size() - 1; i >= 0; i--) {
  ExceptionRangeCFG range = exceptions.get(i);
  List<BasicBlock> lstRange = range.getProtectedRange();
  HashSet<BasicBlock> setBoth = new HashSet<>(common_blocks);
  setBoth.retainAll(lstRange);
  if (setBoth.size() > 0) {
   List<BasicBlock> lstNewRange;
   if (setBoth.size() == lstRange.size()) {
    lstNewRange = new ArrayList<>();
    ExceptionRangeCFG newRange = new ExceptionRangeCFG(lstNewRange,
                              mapNewNodes.get(range.getHandler().id), range.getExceptionTypes());
    exceptions.add(newRange);
   }
   else {
    lstNewRange = lstRange;
   }
   for (BasicBlock block : setBoth) {
    lstNewRange.add(mapNewNodes.get(block.id));
   }
  }
 }
}
origin: spotbugs/spotbugs

/**
 * Do any prep work needed to perform bug filtering
 *
 * @param origCollection
 */
public void getReady(SortedBugCollection origCollection) {
  if (maybeMutatedAsString != null) {
    HashSet<String> addedIssues = new HashSet<>();
    HashSet<String> removedIssues = new HashSet<>();
    for (BugInstance b : origCollection) {
      if (b.getFirstVersion() == maybeMutated) {
        addedIssues.add(getBugLocation(b));
      } else if (b.getLastVersion() == maybeMutated - 1) {
        removedIssues.add(getBugLocation(b));
      }
    }
    addedIssues.remove(null);
    addedIssues.retainAll(removedIssues);
    mutationPoints = addedIssues;
  }
}
origin: apache/zookeeper

for (Proposal.QuorumVerifierAcksetPair qvAckset: p.qvAcksetPairs){
  candidates.retainAll(qvAckset.getAckset());
origin: spotbugs/spotbugs

both.retainAll(oEdges.get(e));
for (E e2 : both) {
  iEdges.remove(e, e2);
origin: org.apache.commons/commons-lang3

testLocales.retainAll(Arrays.asList(NumberFormat.getAvailableLocales()));
testLocales.add(null);
origin: apache/geode

recipients.retainAll(this.dm.getDistributionManagerIds());
if (!recipients.isEmpty()) {
 if (this.txState.internalDuringIndividualSend != null) {
origin: spotbugs/spotbugs

private void pruneConflictingValues(TypeQualifierValueSet fact, TypeQualifierValueSet forwardFact) {
  if (forwardFact.isValid()) {
    HashSet<ValueNumber> valueNumbers = new HashSet<>();
    valueNumbers.addAll(fact.getValueNumbers());
    valueNumbers.retainAll(forwardFact.getValueNumbers());
    for (ValueNumber vn : valueNumbers) {
      if (FlowValue.valuesConflict(typeQualifierValue.isStrictQualifier() && !xmethod.isIdentity(),
          forwardFact.getValue(vn), fact.getValue(vn))) {
        fact.pruneValue(vn);
      }
    }
  }
}
origin: ehcache/ehcache3

clusteredResourceTypes.retainAll(CLUSTER_RESOURCES);
origin: fesh0r/fernflower

setCommonExceptionHandlers.retainAll(pred.getSuccExceptions());
origin: fesh0r/fernflower

setPredHandlersIntersection.retainAll(pred.getSuccExceptions());
origin: lenskit/lenskit

GraphDumper(DAGNode<Component, Dependency> g, Set<DAGNode<Component, Dependency>> unshared, GraphWriter gw) {
  writer = gw;
  graph = g;
  unsharedNodes = Sets.newHashSet(unshared);
  unsharedNodes.retainAll(g.getReachableNodes());
  logger.debug("{} shared nodes", unsharedNodes.size());
  nodeIds = new HashMap<>();
  nodeTargets = new HashMap<>();
  edgeQueue = new LinkedList<>();
}
origin: com.google.gwt/gwt-servlet

 candidateSet = thisWordChoices;
} else {
 candidateSet.retainAll(thisWordChoices);
origin: org.elasticsearch/elasticsearch

/**
 * Validates only 1 vertex is tangential (shared) between the interior and exterior of a polygon
 */
protected void validateHole(LineStringBuilder shell, LineStringBuilder hole) {
  HashSet<Coordinate> exterior = Sets.newHashSet(shell.coordinates);
  HashSet<Coordinate> interior = Sets.newHashSet(hole.coordinates);
  exterior.retainAll(interior);
  if (exterior.size() >= 2) {
    throw new InvalidShapeException("Invalid polygon, interior cannot share more than one point with the exterior");
  }
}
origin: GoogleCloudPlatform/java-docs-samples

/**
 * Looks up the set of documents containing each word. Returns the intersection of these.
 */
public ImmutableSet<String> lookup(Iterable<String> words) {
 HashSet<String> documents = null;
 try (Jedis jedis = pool.getResource()) {
  jedis.select(TOKEN_DB);
  for (String word : words) {
   word = stemmer.stem(word.toLowerCase()).toString();
   if (documents == null) {
    documents = new HashSet();
    documents.addAll(jedis.smembers(word));
   } else {
    documents.retainAll(jedis.smembers(word));
   }
  }
 }
 if (documents == null) {
  return ImmutableSet.<String>of();
 }
 return ImmutableSet.<String>copyOf(documents);
}
origin: apache/accumulo

if (!Collections.disjoint(columnFamilies, previousColumnFamilies)) {
 HashSet<ByteSequence> overlap = new HashSet<>(columnFamilies);
 overlap.retainAll(previousColumnFamilies);
 throw new IllegalArgumentException(
   "Column families over lap with previous locality group : " + overlap);
origin: org.apache.commons/commons-text

testLocales.retainAll(Arrays.asList(NumberFormat.getAvailableLocales()));
testLocales.add(null);
java.utilHashSetretainAll

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,
  • 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 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