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

How to use
removeAll
method
in
com.google.common.collect.Multiset

Best Java code snippets using com.google.common.collect.Multiset.removeAll (Showing top 12 results out of 315)

origin: google/guava

@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testElementSetReflectsRemove() {
 Set<E> elementSet = getMultiset().elementSet();
 assertTrue(elementSet.contains(e0()));
 getMultiset().removeAll(Collections.singleton(e0()));
 assertFalse(elementSet.contains(e0()));
}
origin: google/guava

@CollectionSize.Require(SEVERAL)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveAllIgnoresCount() {
 initThreeCopies();
 assertTrue(getMultiset().removeAll(Collections.singleton(e0())));
 assertEmpty(getMultiset());
}
origin: aadnk/ProtocolLib

@Override
public boolean removeAll(Collection<?> arg0) {
  return multiset.removeAll(arg0);
}
origin: pl.edu.icm.sedno/sedno-tools

private static Multiset<String> createWordsMultiset(String a) {
  Multiset<String> wordsMultisetOfA = HashMultiset.create();
  wordsMultisetOfA.addAll(tokenizeAndFilterAC(a));
  wordsMultisetOfA.removeAll(PL_STOPWORDS);
  return wordsMultisetOfA;
}
origin: SmartDataAnalytics/jena-sparql-api

public static ListDiff<Binding> compareUnordered(ResultSet a, ResultSet b) {
  ListDiff<Binding> result = new ListDiff<>();
  Multiset<Binding> x = toMultiset(a);
  Multiset<Binding> y = toMultiset(b);
  Multiset<Binding> common = HashMultiset.create(Multisets.intersection(x, y));
  y.removeAll(common);
  x.removeAll(common);
  result.getAdded().addAll(y);
  result.getRemoved().addAll(x);
  return result;
}
origin: Stratio/wikipedia-parser

public ImmutableMultiset<String> getTokenCountMultiset() {
  if (_tokenCountMultiset == null) {
    Multiset<String> m = HashMultiset.create(newRevision.getTokens());
    m.removeAll(oldRevision.getTokens());
    _tokenCountMultiset = ImmutableMultiset.copyOf(m);
  }
  return _tokenCountMultiset;
}
origin: com.google.guava/guava-testlib-jdk5

@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testElementSetReflectsRemove() {
 Set<E> elementSet = getMultiset().elementSet();
 assertTrue(elementSet.contains(samples.e0));
 getMultiset().removeAll(Collections.singleton(samples.e0));
 assertFalse(elementSet.contains(samples.e0));
}
origin: com.google.guava/guava-testlib

@CollectionSize.Require(absent = ZERO)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testElementSetReflectsRemove() {
 Set<E> elementSet = getMultiset().elementSet();
 assertTrue(elementSet.contains(e0()));
 getMultiset().removeAll(Collections.singleton(e0()));
 assertFalse(elementSet.contains(e0()));
}
origin: com.google.javascript/closure-compiler

@Override
public final void visit(NodeTraversal traversal, Node n, Node parent) {
 // Remove any guards registered on this node by its children, which are no longer
 // relevant.  This happens first because these were registered on a "parent", but
 // now this is that parent (i.e. `n` here vs `parent` in isGuarded).
 if (parent != null && CAN_HAVE_GUARDS.contains(n.getToken())
   && installedGuards.containsKey(n)) {
  guarded.removeAll(installedGuards.removeAll(n));
 }
 // Check for abrupt returns (`return` and `throw`).
 if (isAbrupt(n)) {
  // If found, any guards installed on a parent IF should be promoted to the
  // grandparent.  This allows a small amount of flow-sensitivity, in that
  //   if (!x) return; x();
  // has the guard for `x` promoted from the `if` to the outer block, so that
  // it guards the next statement.
  promoteAbruptReturns(parent);
 }
 // Finally continue on to whatever the traversal would normally do.
 visitGuarded(traversal, n, parent);
 // After children have been traversed, pop the top of the conditional stack.
 contextStack.pop();
}
origin: com.google.guava/guava-testlib

@CollectionSize.Require(SEVERAL)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveAllIgnoresCount() {
 initThreeCopies();
 assertTrue(getMultiset().removeAll(Collections.singleton(e0())));
 assertEmpty(getMultiset());
}
origin: com.google.guava/guava-testlib-jdk5

@CollectionSize.Require(SEVERAL)
@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testRemoveAllIgnoresCount() {
 initThreeCopies();
 assertTrue(getMultiset().removeAll(Collections.singleton(samples.e0)));
 ASSERT.that(getMultiset()).isEmpty();
}

origin: kframework/k

private void handleBinderVariables(KItem kItem, boolean add) {
  // TODO(AndreiS): fix binder when dealing with KLabel variables and non-concrete KLists
  if (!(kItem.kLabel() instanceof KLabel) || !(kItem.kList() instanceof KList)) {
    return;
  }
  KLabel kLabel = (KLabel) kItem.kLabel();
  KList kList = (KList) kItem.kList();
  if (kLabel instanceof KLabelConstant) {
    KLabelConstant kLabelConstant = (KLabelConstant) kLabel;
    if (kLabelConstant.isBinder()) {  // if label is a binder rename all bound variables
      Multimap<Integer, Integer> binderMap = kLabelConstant.getBinderMap();
      for (Integer keyIndex : binderMap.keySet()) {
        //since a pattern can be on a binding position, we need to collect and bind all variables in the pattern
        if (add) {
          boundVariables.addAll(kList.get(keyIndex).userVariableSet(kItem.globalContext()));
        } else {
          boundVariables.removeAll(kList.get(keyIndex).userVariableSet(kItem.globalContext()));
        }
      }
    }
  }
}
com.google.common.collectMultisetremoveAll

Javadoc

Note: This method ignores how often any element might appear in c, and only cares whether or not an element appears at all. If you wish to remove one occurrence in this multiset for every occurrence in c, see Multisets#removeOccurrences(Multiset,Multiset).

This method refines Collection#removeAll to further specify that it may not throw an exception in response to any of elementsbeing null or of the wrong type.

Popular methods of Multiset

  • add
    Adds a number of occurrences of an element to this multiset. Note that if occurrences == 1, this met
  • count
    Returns the number of occurrences of an element in this multiset (thecount of the element). Note tha
  • elementSet
    Returns the set of distinct elements contained in this multiset. The element set is backed by the sa
  • entrySet
    Returns a view of the contents of this multiset, grouped into Multiset.Entry instances, each providi
  • remove
    Removes a number of occurrences of the specified element from this multiset. If the multiset contain
  • size
    Returns the total number of all occurrences of all elements in this multiset. Note: this method does
  • isEmpty
  • clear
  • contains
    Determines whether this multiset contains the specified element.This method refines Collection#conta
  • addAll
  • setCount
    Conditionally sets the count of an element to a new value, as described in #setCount(Object,int), pr
  • iterator
    Elements that occur multiple times in the multiset will appear multiple times in this iterator, thou
  • setCount,
  • iterator,
  • equals,
  • containsAll,
  • hashCode,
  • toString,
  • stream,
  • forEachEntry,
  • retainAll

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JFrame (javax.swing)
  • JPanel (javax.swing)
  • CodeWhisperer alternatives
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