Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for oldCount (0.05 sec)

  1. guava/src/com/google/common/collect/AbstractMapBasedMultiset.java

        Count frequency = backingMap.get(element);
        int oldCount;
        if (frequency == null) {
          oldCount = 0;
          backingMap.put(element, new Count(occurrences));
        } else {
          oldCount = frequency.get();
          long newCount = (long) oldCount + (long) occurrences;
          checkArgument(newCount <= Integer.MAX_VALUE, "too many occurrences: %s", newCount);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/AbstractMapBasedMultiset.java

        checkNonnegative(count, "count");
        int oldCount = (count == 0) ? backingMap.remove(element) : backingMap.put(element, count);
        size += (count - oldCount);
        return oldCount;
      }
    
      @Override
      public final boolean setCount(@ParametricNullness E element, int oldCount, int newCount) {
        checkNonnegative(oldCount, "oldCount");
        checkNonnegative(newCount, "newCount");
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 06 16:06:58 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/collect/testing/google/MultisetSetCountConditionallyTester.java

      private void assertSetCountNegativeOldCount() {
        try {
          getMultiset().setCount(e3(), -1, 1);
          fail("calling setCount() with a negative oldCount should throw IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
      }
    
      // Negative oldCount.
    
      @CollectionFeature.Require(SUPPORTS_ADD)
      public void testSetCountConditional_negativeOldCount_addSupported() {
        assertSetCountNegativeOldCount();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 24 20:12:35 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  4. guava-testlib/src/com/google/common/collect/testing/google/MultisetSetCountConditionallyTester.java

      private void assertSetCountNegativeOldCount() {
        try {
          getMultiset().setCount(e3(), -1, 1);
          fail("calling setCount() with a negative oldCount should throw IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
      }
    
      // Negative oldCount.
    
      @CollectionFeature.Require(SUPPORTS_ADD)
      public void testSetCountConditional_negativeOldCount_addSupported() {
        assertSetCountNegativeOldCount();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 24 20:12:35 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/ForwardingMultiset.java

        return delegate().setCount(element, count);
      }
    
      @CanIgnoreReturnValue
      @Override
      public boolean setCount(@ParametricNullness E element, int oldCount, int newCount) {
        return delegate().setCount(element, oldCount, newCount);
      }
    
      /**
       * A sensible definition of {@link #contains} in terms of {@link #count}. If you override {@link
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 12 15:26:39 UTC 2023
    - 10.4K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/FilteredEntryMultimap.java

          K k = (K) key;
          int oldCount = 0;
          Iterator<V> itr = collection.iterator();
          while (itr.hasNext()) {
            V v = itr.next();
            if (satisfies(k, v)) {
              oldCount++;
              if (oldCount <= occurrences) {
                itr.remove();
              }
            }
          }
          return oldCount;
        }
    
        @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/ForwardingMultisetTest.java

        }
    
        @Override
        public int hashCode() {
          return standardHashCode();
        }
    
        @Override
        public boolean setCount(T element, int oldCount, int newCount) {
          return standardSetCount(element, oldCount, newCount);
        }
    
        @Override
        public int setCount(T element, int count) {
          return standardSetCount(element, count);
        }
    
        @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/Multisets.java

          Multiset<E> self, @ParametricNullness E element, int oldCount, int newCount) {
        checkNonnegative(oldCount, "oldCount");
        checkNonnegative(newCount, "newCount");
    
        if (self.count(element) == oldCount) {
          self.setCount(element, newCount);
          return true;
        } else {
          return false;
        }
      }
    
      static <E extends @Nullable Object> Iterator<E> elementIterator(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 41.7K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/Multisets.java

          Multiset<E> self, @ParametricNullness E element, int oldCount, int newCount) {
        checkNonnegative(oldCount, "oldCount");
        checkNonnegative(newCount, "newCount");
    
        if (self.count(element) == oldCount) {
          self.setCount(element, newCount);
          return true;
        } else {
          return false;
        }
      }
    
      static <E extends @Nullable Object> Iterator<E> elementIterator(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 41.5K bytes
    - Viewed (0)
  10. guava/src/com/google/common/collect/FilteredEntryMultimap.java

          K k = (K) key;
          int oldCount = 0;
          Iterator<V> itr = collection.iterator();
          while (itr.hasNext()) {
            V v = itr.next();
            if (satisfies(k, v)) {
              oldCount++;
              if (oldCount <= occurrences) {
                itr.remove();
              }
            }
          }
          return oldCount;
        }
    
        @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 12.1K bytes
    - Viewed (0)
Back to top