Codota Logo
Multiset.isEmpty
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using com.google.common.collect.Multiset.isEmpty (Showing top 20 results out of 504)

  • Common ways to obtain Multiset
private void myMethod () {
Multiset m =
  • Codota IconMultimap fromMultimap;fromMultimap.keys()
  • Codota Iconnew Keys()
  • Codota Iconnew Multimaps.Keys<K, V>(this)
  • Smart code suggestions by Codota
}
origin: google/guava

@Override
public boolean isEmpty() {
 return multiset1.isEmpty() && multiset2.isEmpty();
}
origin: google/guava

@Override
public boolean isEmpty() {
 return multiset1.isEmpty() && multiset2.isEmpty();
}
origin: google/guava

/** A specialization of {@code addAllImpl} for when {@code elements} is itself a Multiset. */
private static <E> boolean addAllImpl(Multiset<E> self, Multiset<? extends E> elements) {
 if (elements.isEmpty()) {
  return false;
 }
 elements.forEachEntry(self::add);
 return true;
}
origin: google/guava

@Override
public boolean isEmpty() {
 return multiset().isEmpty();
}
origin: google/guava

 @VisibleForTesting
 ImmutableMultiset<E> buildJdkBacked() {
  if (contents.isEmpty()) {
   return of();
  }
  return JdkBackedImmutableMultiset.create(contents.entrySet());
 }
}
origin: google/guava

@CollectionFeature.Require(SUPPORTS_REMOVE)
public void testEntrySet_clear() {
 getMultiset().entrySet().clear();
 assertTrue("multiset not empty after entrySet().clear()", getMultiset().isEmpty());
}
origin: google/guava

public void testCopyOf_multiset_empty() {
 Multiset<String> c = HashMultiset.create();
 Multiset<String> multiset = ImmutableMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_multiset_empty() {
 Multiset<String> c = HashMultiset.create();
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testRemoveOccurrencesMultisetEmpty() {
 Multiset<String> multiset = HashMultiset.create();
 Multiset<String> toRemove = HashMultiset.create(Arrays.asList("a", "b", "a"));
 assertFalse(Multisets.removeOccurrences(multiset, toRemove));
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testRetainEmptyOccurrences() {
 Multiset<String> multiset = HashMultiset.create(Arrays.asList("a", "b", "a"));
 Multiset<String> toRetain = HashMultiset.create();
 assertTrue(Multisets.retainOccurrences(multiset, toRetain));
 assertTrue(multiset.isEmpty());
}
origin: google/guava

@CollectionSize.Require(ONE)
@CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE)
public void testEntrySet_iteratorRemovePropagates() {
 Iterator<Multiset.Entry<E>> iterator = getMultiset().entrySet().iterator();
 assertTrue(
   "non-empty multiset.entrySet() iterator.hasNext() returned false", iterator.hasNext());
 assertEquals(
   "multiset.entrySet() iterator.next() returned incorrect entry",
   Multisets.immutableEntry(e0(), 1),
   iterator.next());
 assertFalse(
   "size 1 multiset.entrySet() iterator.hasNext() returned true after next()",
   iterator.hasNext());
 iterator.remove();
 assertTrue(
   "multiset isn't empty after multiset.entrySet() iterator.remove()",
   getMultiset().isEmpty());
}
origin: google/guava

public void testCreation_emptyArray() {
 String[] array = new String[0];
 Multiset<String> multiset = ImmutableMultiset.copyOf(array);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testRemoveOccurrencesIterableEmpty() {
 Multiset<String> multiset = HashMultiset.create();
 Iterable<String> toRemove = Arrays.asList("a", "b", "a");
 assertFalse(Multisets.removeOccurrences(multiset, toRemove));
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCreation_emptyArray() {
 String[] array = new String[0];
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(array);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCreation_noArgs() {
 Multiset<String> multiset = ImmutableMultiset.of();
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCreation_noArgs() {
 Multiset<String> multiset = ImmutableSortedMultiset.of();
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_iterator_empty() {
 Iterator<String> iterator = Iterators.emptyIterator();
 Multiset<String> multiset = ImmutableMultiset.copyOf(iterator);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_collection_empty() {
 // "<String>" is required to work around a javac 1.5 bug.
 Collection<String> c = MinimalCollection.<String>of();
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_collection_empty() {
 // "<String>" is required to work around a javac 1.5 bug.
 Collection<String> c = MinimalCollection.<String>of();
 Multiset<String> multiset = ImmutableMultiset.copyOf(c);
 assertTrue(multiset.isEmpty());
}
origin: google/guava

public void testCopyOf_iterator_empty() {
 Iterator<String> iterator = Iterators.emptyIterator();
 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(iterator);
 assertTrue(multiset.isEmpty());
}
com.google.common.collectMultisetisEmpty

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
  • 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
  • equals
    Compares the specified object with this multiset for equality. Returns true if the given object is a
  • iterator,
  • equals,
  • containsAll,
  • hashCode,
  • removeAll,
  • toString,
  • stream,
  • forEachEntry,
  • retainAll

Popular in Java

  • Start an intent from android
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
  • addToBackStack (FragmentTransaction)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now