Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 158 for Multisets (0.05 seconds)

  1. guava-testlib/src/com/google/common/collect/testing/google/MultisetElementSetTester.java

        getMultiset().elementSet().clear();
        assertEmpty(getMultiset());
      }
    
      /**
       * Returns {@link Method} instances for the read tests that assume multisets support duplicates so
       * that the test of {@code Multisets.forSet()} can suppress them.
       */
      @J2ktIncompatible
      @GwtIncompatible // reflection
      public static List<Method> getElementSetDuplicateInitializingMethods() {
        return asList(
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Nov 14 23:40:07 GMT 2024
    - 4.3K bytes
    - Click Count (0)
  2. guava-testlib/src/com/google/common/collect/testing/google/MultisetTestSuiteBuilder.java

              Multisets.immutableEntry(samples.e0(), 3),
              Multisets.immutableEntry(samples.e1(), 4),
              Multisets.immutableEntry(samples.e2(), 1),
              Multisets.immutableEntry(samples.e3(), 5),
              Multisets.immutableEntry(samples.e4(), 2));
        }
    
        @Override
        public Set<Multiset.Entry<E>> create(Object... entries) {
          List<Object> contents = new ArrayList<>();
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Sat Aug 09 01:14:59 GMT 2025
    - 10.5K bytes
    - Click Count (0)
  3. android/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java

        treeMultiset = TreeMultiset.create();
    
        Random random = new Random();
    
        int sizeRemaining = size;
    
        // TODO(kevinb): generate better test contents for multisets
        while (sizeRemaining > 0) {
          // The JVM will return interned values for small ints.
          Integer value = random.nextInt(1000) + 128;
          int count = min(random.nextInt(10) + 1, sizeRemaining);
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Dec 19 18:03:30 GMT 2024
    - 2.7K bytes
    - Click Count (0)
  4. guava-testlib/src/com/google/common/collect/testing/google/MultisetReadsTester.java

      public void testEquals_yes() {
        assertTrue(
            "multiset doesn't equal a multiset with the same elements",
            getMultiset().equals(HashMultiset.create(getSampleElements())));
      }
    
      public void testEquals_differentSize() {
        Multiset<E> other = HashMultiset.create(getSampleElements());
        other.add(e0());
        assertFalse("multiset equals a multiset with a different size", getMultiset().equals(other));
      }
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Nov 14 23:40:07 GMT 2024
    - 4K bytes
    - Click Count (0)
  5. android/guava-testlib/src/com/google/common/collect/testing/google/MultisetReadsTester.java

      public void testEquals_yes() {
        assertTrue(
            "multiset doesn't equal a multiset with the same elements",
            getMultiset().equals(HashMultiset.create(getSampleElements())));
      }
    
      public void testEquals_differentSize() {
        Multiset<E> other = HashMultiset.create(getSampleElements());
        other.add(e0());
        assertFalse("multiset equals a multiset with a different size", getMultiset().equals(other));
      }
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Nov 14 23:40:07 GMT 2024
    - 4K bytes
    - Click Count (0)
  6. guava-tests/test/com/google/common/collect/MultisetsImmutableEntryTest.java

    import static java.util.Collections.nCopies;
    
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.collect.Multiset.Entry;
    import junit.framework.TestCase;
    import org.jspecify.annotations.NullMarked;
    import org.jspecify.annotations.Nullable;
    
    /**
     * Tests for {@link Multisets#immutableEntry}.
     *
     * @author Mike Bostock
     */
    @GwtCompatible
    @NullMarked
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue May 13 18:46:00 GMT 2025
    - 2.8K bytes
    - Click Count (0)
  7. guava/src/com/google/common/collect/DescendingMultiset.java

        return (result == null) ? entrySet = createEntrySet() : result;
      }
    
      Set<Entry<E>> createEntrySet() {
        @WeakOuter
        final class EntrySetImpl extends Multisets.EntrySet<E> {
          @Override
          Multiset<E> multiset() {
            return DescendingMultiset.this;
          }
    
          @Override
          public Iterator<Entry<E>> iterator() {
            return entryIterator();
          }
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Mon Sep 22 18:35:44 GMT 2025
    - 4.4K bytes
    - Click Count (0)
  8. guava/src/com/google/common/collect/AbstractSortedMultiset.java

      }
    
      @Override
      public @Nullable Entry<E> pollFirstEntry() {
        Iterator<Entry<E>> entryIterator = entryIterator();
        if (entryIterator.hasNext()) {
          Entry<E> result = entryIterator.next();
          result = Multisets.immutableEntry(result.getElement(), result.getCount());
          entryIterator.remove();
          return result;
        }
        return null;
      }
    
      @Override
      public @Nullable Entry<E> pollLastEntry() {
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Sat Aug 09 01:14:59 GMT 2025
    - 4.5K bytes
    - Click Count (0)
  9. guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java

      public void testCreation_noArgs() {
        Multiset<String> multiset = ImmutableSortedMultiset.of();
        assertTrue(multiset.isEmpty());
      }
    
      public void testCreation_oneElement() {
        Multiset<String> multiset = ImmutableSortedMultiset.of("a");
        assertEquals(HashMultiset.create(asList("a")), multiset);
      }
    
      public void testCreation_twoElements() {
        Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b");
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue May 13 17:27:14 GMT 2025
    - 22.7K bytes
    - Click Count (0)
  10. guava/src/com/google/common/collect/ForwardingSortedMultiset.java

    import java.util.Iterator;
    import java.util.NavigableSet;
    import org.jspecify.annotations.Nullable;
    
    /**
     * A sorted multiset which forwards all its method calls to another sorted multiset. Subclasses
     * should override one or more methods to modify the behavior of the backing multiset as desired per
     * the <a href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
     *
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Aug 07 16:05:33 GMT 2025
    - 8.6K bytes
    - Click Count (0)
Back to Top