Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for sum (0.14 sec)

  1. android/guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java

        int expectedHashCode = 0;
        for (E element : getSampleElements()) {
          expectedHashCode += ((element == null) ? 0 : element.hashCode());
        }
        assertEquals(
            "A Set's hashCode() should be the sum of those of its elements.",
            expectedHashCode,
            getSet().hashCode());
      }
    
      @CollectionSize.Require(absent = CollectionSize.ZERO)
      @CollectionFeature.Require(ALLOWS_NULL_VALUES)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 3K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java

        int expectedHashCode = 0;
        for (E element : getSampleElements()) {
          expectedHashCode += ((element == null) ? 0 : element.hashCode());
        }
        assertEquals(
            "A Set's hashCode() should be the sum of those of its elements.",
            expectedHashCode,
            getSet().hashCode());
      }
    
      @CollectionSize.Require(absent = CollectionSize.ZERO)
      @CollectionFeature.Require(ALLOWS_NULL_VALUES)
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/TableCollectorsTest.java

        Collector<Cell<String, String, Integer>, ?, ImmutableTable<String, String, Integer>> collector =
            TableCollectors.toImmutableTable(
                Cell::getRowKey, Cell::getColumnKey, Cell::getValue, Integer::sum);
        BiPredicate<ImmutableTable<String, String, Integer>, ImmutableTable<String, String, Integer>>
            equivalence = pairwiseOnResultOf(ImmutableTable::cellSet);
        CollectorTester.of(collector, equivalence)
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Mar 05 16:03:18 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/collect/MultisetsTest.java

        Multiset<String> ms2 = HashMultiset.create(Arrays.asList("b", "c"));
        assertThat(Multisets.sum(ms1, ms2)).containsExactly("a", "a", "b", "b", "c");
      }
    
      public void testSumEmptyNonempty() {
        Multiset<String> ms1 = HashMultiset.create();
        Multiset<String> ms2 = HashMultiset.create(Arrays.asList("a", "b", "a"));
        assertThat(Multisets.sum(ms1, ms2)).containsExactly("a", "b", "a");
      }
    
      public void testSumNonemptyEmpty() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Feb 19 20:34:55 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/MapMakerInternalMap.java

            }
            sum -= segments[i].modCount;
          }
          return sum == 0L;
        }
        return true;
      }
    
      @Override
      public int size() {
        Segment<K, V, E, S>[] segments = this.segments;
        long sum = 0;
        for (int i = 0; i < segments.length; ++i) {
          sum += segments[i].count;
        }
        return Ints.saturatedCast(sum);
      }
    
      @CheckForNull
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 91.9K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java

       * undefined which (if any) of these modifications will be reflected in the result.
       */
      @Override
      public int size() {
        long sum = 0L;
        for (AtomicInteger value : countMap.values()) {
          sum += value.get();
        }
        return Ints.saturatedCast(sum);
      }
    
      /*
       * Note: the superclass toArray() methods assume that size() gives a correct
       * answer, which ours does not.
       */
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  7. guava/src/com/google/common/cache/LocalCache.java

            }
            sum -= segment.modCount;
          }
          return sum == 0L;
        }
        return true;
      }
    
      long longSize() {
        Segment<K, V>[] segments = this.segments;
        long sum = 0;
        for (Segment<K, V> segment : segments) {
          sum += segment.count;
        }
        return sum;
      }
    
      @Override
      public int size() {
        return Ints.saturatedCast(longSize());
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 150.3K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/collect/MultisetsTest.java

        Multiset<String> ms2 = HashMultiset.create(Arrays.asList("b", "c"));
        assertThat(Multisets.sum(ms1, ms2)).containsExactly("a", "a", "b", "b", "c");
      }
    
      public void testSumEmptyNonempty() {
        Multiset<String> ms1 = HashMultiset.create();
        Multiset<String> ms2 = HashMultiset.create(Arrays.asList("a", "b", "a"));
        assertThat(Multisets.sum(ms1, ms2)).containsExactly("a", "b", "a");
      }
    
      public void testSumNonemptyEmpty() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Feb 19 20:34:55 GMT 2024
    - 11.3K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/collect/testing/SpliteratorTester.java

                    trySplit.estimateSize(), originalSize));
          }
        }
        if (subsized) {
          if (trySplit != null) {
            assertEquals(
                "sum of estimated sizes of trySplit and original spliterator after trySplit",
                originalSize,
                trySplit.estimateSize() + spliterator.estimateSize());
          } else {
            assertEquals(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 22 18:19:31 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/Multisets.java

                }
                return endOfData();
              }
            };
          }
        };
      }
    
      /**
       * Returns an unmodifiable view of the sum of two multisets. In the returned multiset, the count
       * of each element is the <i>sum</i> of its counts in the two backing multisets. The iteration
       * order of the returned multiset matches that of the element set of {@code multiset1} followed by
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 41.7K bytes
    - Viewed (0)
Back to top