Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for forEachEntry (0.19 sec)

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

    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collections;
    import java.util.List;
    import org.junit.Ignore;
    
    /**
     * Tests for {@code Multiset#forEachEntry}.
     *
     * @author Louis Wasserman
     */
    @GwtCompatible(emulated = true)
    @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 21 16:49:06 UTC 2024
    - 3K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/RegularImmutableSortedMultiset.java

      }
    
      @Override
      Entry<E> getEntry(int index) {
        return Multisets.immutableEntry(elementSet.asList().get(index), getCount(index));
      }
    
      @Override
      public void forEachEntry(ObjIntConsumer<? super E> action) {
        checkNotNull(action);
        for (int i = 0; i < length; i++) {
          action.accept(elementSet.asList().get(i), getCount(i));
        }
      }
    
      @Override
      @CheckForNull
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  3. guava/src/com/google/common/collect/EnumMultiset.java

              }
    
              @Override
              public int getCount() {
                return counts[index];
              }
            };
          }
        };
      }
    
      @Override
      public void forEachEntry(ObjIntConsumer<? super E> action) {
        checkNotNull(action);
        for (int i = 0; i < enumConstants.length; i++) {
          if (counts[i] > 0) {
            action.accept(enumConstants[i], counts[i]);
          }
        }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  4. guava/src/com/google/common/collect/ImmutableMultiset.java

        @Override
        public Builder<E> addAll(Iterable<? extends E> elements) {
          if (elements instanceof Multiset) {
            Multiset<? extends E> multiset = Multisets.cast(elements);
            multiset.forEachEntry((e, n) -> contents.add(checkNotNull(e), n));
          } else {
            super.addAll(elements);
          }
          return this;
        }
    
        /**
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed May 08 03:01:02 UTC 2024
    - 20.6K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java

        ImmutableSortedMultiset<String> multiset =
            ImmutableSortedMultiset.<String>naturalOrder().add("a").add("b").add("a").add("c").build();
        List<Multiset.Entry<String>> entries = new ArrayList<>();
        multiset.forEachEntry((e, c) -> entries.add(Multisets.immutableEntry(e, c)));
        assertThat(entries)
            .containsExactly(
                Multisets.immutableEntry("a", 2),
                Multisets.immutableEntry("b", 1),
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 17 15:27:58 UTC 2024
    - 22.5K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/TreeMultiset.java

            setCount(prevEntry.getElement(), 0);
            prevEntry = null;
          }
        };
      }
    
      @Override
      public void forEachEntry(ObjIntConsumer<? super E> action) {
        checkNotNull(action);
        for (AvlNode<E> node = firstNode();
            node != header && node != null && !range.tooHigh(node.getElement());
            node = node.succ()) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 34.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/Multisets.java

      private static <E extends @Nullable Object> boolean addAllImpl(
          Multiset<E> self, Multiset<? extends E> elements) {
        if (elements.isEmpty()) {
          return false;
        }
        elements.forEachEntry(self::add);
        return true;
      }
    
      /** An implementation of {@link Multiset#removeAll}. */
      static boolean removeAllImpl(Multiset<?> self, Collection<?> elementsToRemove) {
        Collection<?> collection =
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 41.4K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/Maps.java

              return entrySpliterator();
            }
    
            @Override
            public void forEach(Consumer<? super Entry<K, V>> action) {
              forEachEntry(action);
            }
          };
        }
    
        void forEachEntry(Consumer<? super Entry<K, V>> action) {
          entryIterator().forEachRemaining(action);
        }
    
        @Override
        public void clear() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Apr 24 19:38:27 UTC 2024
    - 165.9K bytes
    - Viewed (0)
Back to top