/external/guava/guava-tests/test/com/google/common/collect/ |
D | ConcurrentHashMultisetTest.java | 89 Multiset<String> multiset = new ConcurrentHashMultiset<String>( 91 Collections.addAll(multiset, elements); 92 return multiset; 105 ConcurrentHashMultiset<String> multiset; 113 multiset = new ConcurrentHashMultiset<String>(backingMap); 123 assertEquals(COUNT, multiset.count(KEY)); 131 assertEquals(0, multiset.count(KEY)); 140 assertEquals(INITIAL_COUNT, multiset.add(KEY, 0)); 151 assertEquals(0, multiset.add(KEY, COUNT)); 163 assertEquals(INITIAL_COUNT, multiset.add(KEY, COUNT_TO_ADD)); [all …]
|
D | HashMultisetTest.java | 71 Multiset<String> multiset = HashMultiset.create(); 72 multiset.add("foo", 2); 73 multiset.add("bar"); 74 assertEquals(3, multiset.size()); 75 assertEquals(2, multiset.count("foo")); 79 Multiset<String> multiset = HashMultiset.create(50); 80 multiset.add("foo", 2); 81 multiset.add("bar"); 82 assertEquals(3, multiset.size()); 83 assertEquals(2, multiset.count("foo")); [all …]
|
D | ImmutableMultisetTest.java | 134 Multiset<String> multiset = ImmutableMultiset.of(); in testCreation_noArgs() local 135 assertTrue(multiset.isEmpty()); in testCreation_noArgs() 139 Multiset<String> multiset = ImmutableMultiset.of("a"); in testCreation_oneElement() local 140 assertEquals(HashMultiset.create(asList("a")), multiset); in testCreation_oneElement() 144 Multiset<String> multiset = ImmutableMultiset.of("a", "b"); in testCreation_twoElements() local 145 assertEquals(HashMultiset.create(asList("a", "b")), multiset); in testCreation_twoElements() 149 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c"); in testCreation_threeElements() local 150 assertEquals(HashMultiset.create(asList("a", "b", "c")), multiset); in testCreation_threeElements() 154 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c", "d"); in testCreation_fourElements() local 155 assertEquals(HashMultiset.create(asList("a", "b", "c", "d")), multiset); in testCreation_fourElements() [all …]
|
D | ImmutableSortedMultisetTest.java | 121 Multiset<String> multiset = ImmutableSortedMultiset.of(); in testCreation_noArgs() local 122 assertTrue(multiset.isEmpty()); in testCreation_noArgs() 126 Multiset<String> multiset = ImmutableSortedMultiset.of("a"); in testCreation_oneElement() local 127 assertEquals(HashMultiset.create(asList("a")), multiset); in testCreation_oneElement() 131 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b"); in testCreation_twoElements() local 132 assertEquals(HashMultiset.create(asList("a", "b")), multiset); in testCreation_twoElements() 136 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c"); in testCreation_threeElements() local 137 assertEquals(HashMultiset.create(asList("a", "b", "c")), multiset); in testCreation_threeElements() 141 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c", "d"); in testCreation_fourElements() local 142 assertEquals(HashMultiset.create(asList("a", "b", "c", "d")), multiset); in testCreation_fourElements() [all …]
|
D | MultisetsTest.java | 65 TreeMultiset<String> multiset in testNewTreeMultisetComparator() local 67 multiset.add("bar", 3); in testNewTreeMultisetComparator() 68 multiset.add("foo", 2); in testNewTreeMultisetComparator() 69 assertThat(multiset).has().exactly("foo", "foo", "bar", "bar", "bar").inOrder(); in testNewTreeMultisetComparator() 73 Multiset<String> multiset = HashMultiset.create(); in testRetainOccurrencesEmpty() local 76 assertFalse(Multisets.retainOccurrences(multiset, toRetain)); in testRetainOccurrencesEmpty() 77 assertThat(multiset).isEmpty(); in testRetainOccurrencesEmpty() 81 Multiset<String> multiset = HashMultiset.create(); in testRemoveOccurrencesIterableEmpty() local 83 assertFalse(Multisets.removeOccurrences(multiset, toRemove)); in testRemoveOccurrencesIterableEmpty() 84 assertTrue(multiset.isEmpty()); in testRemoveOccurrencesIterableEmpty() [all …]
|
D | LinkedHashMultisetTest.java | 85 Multiset<String> multiset = LinkedHashMultiset.create(); 86 multiset.add("foo", 2); 87 multiset.add("bar"); 88 assertEquals(3, multiset.size()); 89 assertEquals(2, multiset.count("foo")); 90 assertEquals("[foo x 2, bar]", multiset.toString()); 94 Multiset<String> multiset = LinkedHashMultiset.create(50); 95 multiset.add("foo", 2); 96 multiset.add("bar"); 97 assertEquals(3, multiset.size()); [all …]
|
D | ConcurrentHashMultisetBasherTest.java | 65 final ConcurrentHashMultiset<String> multiset = new ConcurrentHashMultiset<String>(map); in testAddAndRemove() local 74 futures.add(pool.submit(new MutateTask(multiset, keys))); in testAddAndRemove() 88 return multiset.count(key); in testAddAndRemove() 103 private final ConcurrentHashMultiset<String> multiset; field in ConcurrentHashMultisetBasherTest.MutateTask 107 private MutateTask(ConcurrentHashMultiset<String> multiset, ImmutableList<String> keys) { in MutateTask() argument 108 this.multiset = multiset; in MutateTask() 124 multiset.add(key, delta); in call() 130 int oldValue = multiset.setCount(key, newValue); in call() 136 int oldValue = multiset.count(key); in call() 137 if (multiset.setCount(key, oldValue, newValue)) { in call() [all …]
|
D | TreeMultisetTest.java | 120 TreeMultiset<String> multiset = TreeMultiset.create(); in testCreate() local 121 multiset.add("foo", 2); in testCreate() 122 multiset.add("bar"); in testCreate() 123 assertEquals(3, multiset.size()); in testCreate() 124 assertEquals(2, multiset.count("foo")); in testCreate() 125 assertEquals(Ordering.natural(), multiset.comparator()); in testCreate() 126 assertEquals("[bar, foo x 2]", multiset.toString()); in testCreate() 130 Multiset<String> multiset = TreeMultiset.create(Collections.reverseOrder()); in testCreateWithComparator() local 131 multiset.add("foo", 2); in testCreateWithComparator() 132 multiset.add("bar"); in testCreateWithComparator() [all …]
|
/external/guava/guava-gwt/test-super/com/google/common/collect/super/com/google/common/collect/ |
D | ImmutableMultisetTest.java | 42 Multiset<String> multiset = ImmutableMultiset.of(); in testCreation_noArgs() local 43 assertTrue(multiset.isEmpty()); in testCreation_noArgs() 47 Multiset<String> multiset = ImmutableMultiset.of("a"); in testCreation_oneElement() local 48 assertEquals(HashMultiset.create(asList("a")), multiset); in testCreation_oneElement() 52 Multiset<String> multiset = ImmutableMultiset.of("a", "b"); in testCreation_twoElements() local 53 assertEquals(HashMultiset.create(asList("a", "b")), multiset); in testCreation_twoElements() 57 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c"); in testCreation_threeElements() local 58 assertEquals(HashMultiset.create(asList("a", "b", "c")), multiset); in testCreation_threeElements() 62 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c", "d"); in testCreation_fourElements() local 63 assertEquals(HashMultiset.create(asList("a", "b", "c", "d")), multiset); in testCreation_fourElements() [all …]
|
D | HashMultisetTest.java | 46 Multiset<String> multiset = HashMultiset.create(); 47 multiset.add("foo", 2); 48 multiset.add("bar"); 49 assertEquals(3, multiset.size()); 50 assertEquals(2, multiset.count("foo")); 54 Multiset<String> multiset = HashMultiset.create(50); 55 multiset.add("foo", 2); 56 multiset.add("bar"); 57 assertEquals(3, multiset.size()); 58 assertEquals(2, multiset.count("foo")); [all …]
|
D | LinkedHashMultisetTest.java | 61 Multiset<String> multiset = LinkedHashMultiset.create(); 62 multiset.add("foo", 2); 63 multiset.add("bar"); 64 assertEquals(3, multiset.size()); 65 assertEquals(2, multiset.count("foo")); 66 assertEquals("[foo x 2, bar]", multiset.toString()); 70 Multiset<String> multiset = LinkedHashMultiset.create(50); 71 multiset.add("foo", 2); 72 multiset.add("bar"); 73 assertEquals(3, multiset.size()); [all …]
|
D | MultisetsTest.java | 63 TreeMultiset<String> multiset in testNewTreeMultisetComparator() local 65 multiset.add("bar", 3); in testNewTreeMultisetComparator() 66 multiset.add("foo", 2); in testNewTreeMultisetComparator() 67 assertThat(multiset).has().exactly("foo", "foo", "bar", "bar", "bar").inOrder(); in testNewTreeMultisetComparator() 71 Multiset<String> multiset = HashMultiset.create(); in testRetainOccurrencesEmpty() local 74 assertFalse(Multisets.retainOccurrences(multiset, toRetain)); in testRetainOccurrencesEmpty() 75 assertThat(multiset).isEmpty(); in testRetainOccurrencesEmpty() 79 Multiset<String> multiset = HashMultiset.create(); in testRemoveOccurrencesIterableEmpty() local 81 assertFalse(Multisets.removeOccurrences(multiset, toRemove)); in testRemoveOccurrencesIterableEmpty() 82 assertTrue(multiset.isEmpty()); in testRemoveOccurrencesIterableEmpty() [all …]
|
D | TreeMultisetTest.java | 40 TreeMultiset<String> multiset = TreeMultiset.create(); in testCreate() local 41 multiset.add("foo", 2); in testCreate() 42 multiset.add("bar"); in testCreate() 43 assertEquals(3, multiset.size()); in testCreate() 44 assertEquals(2, multiset.count("foo")); in testCreate() 45 assertEquals(Ordering.natural(), multiset.comparator()); in testCreate() 46 assertEquals("[bar, foo x 2]", multiset.toString()); in testCreate() 50 Multiset<String> multiset = TreeMultiset.create(Collections.reverseOrder()); in testCreateWithComparator() local 51 multiset.add("foo", 2); in testCreateWithComparator() 52 multiset.add("bar"); in testCreateWithComparator() [all …]
|
/external/guava/guava/src/com/google/common/collect/ |
D | SortedMultisets.java | 50 private final SortedMultiset<E> multiset; field in SortedMultisets.ElementSet 52 ElementSet(SortedMultiset<E> multiset) { in ElementSet() argument 53 this.multiset = multiset; in ElementSet() 56 @Override final SortedMultiset<E> multiset() { in multiset() method in SortedMultisets.ElementSet 57 return multiset; in multiset() 61 return multiset().comparator(); in comparator() 65 return multiset().subMultiset(fromElement, CLOSED, toElement, OPEN).elementSet(); in subSet() 69 return multiset().headMultiset(toElement, OPEN).elementSet(); in headSet() 73 return multiset().tailMultiset(fromElement, CLOSED).elementSet(); in tailSet() 77 return getElementOrThrow(multiset().firstEntry()); in first() [all …]
|
D | Multisets.java | 73 Multiset<? extends E> multiset) { in unmodifiableMultiset() argument 74 if (multiset instanceof UnmodifiableMultiset || in unmodifiableMultiset() 75 multiset instanceof ImmutableMultiset) { in unmodifiableMultiset() 78 Multiset<E> result = (Multiset<E>) multiset; in unmodifiableMultiset() 81 return new UnmodifiableMultiset<E>(checkNotNull(multiset)); in unmodifiableMultiset() 91 ImmutableMultiset<E> multiset) { in unmodifiableMultiset() argument 92 return checkNotNull(multiset); in unmodifiableMultiset() 819 static boolean equalsImpl(Multiset<?> multiset, @Nullable Object object) { 820 if (object == multiset) { 831 if (multiset.size() != that.size() [all …]
|
D | ImmutableMultiset.java | 182 Multiset<? extends E> multiset = (elements instanceof Multiset) in copyOf() local 186 return copyOfInternal(multiset); in copyOf() 194 Multiset<? extends E> multiset) { in copyOfInternal() argument 195 return copyFromEntries(multiset.entrySet()); in copyOfInternal() 231 Multiset<E> multiset = LinkedHashMultiset.create(); in copyOf() local 232 Iterators.addAll(multiset, elements); in copyOf() 233 return copyOfInternal(multiset); in copyOf() 416 final ImmutableMultiset<E> multiset; 418 EntrySetSerializedForm(ImmutableMultiset<E> multiset) { 419 this.multiset = multiset; [all …]
|
/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ |
D | SortedMultisets.java | 47 private final SortedMultiset<E> multiset; field in SortedMultisets.ElementSet 49 ElementSet(SortedMultiset<E> multiset) { in ElementSet() argument 50 this.multiset = multiset; in ElementSet() 53 @Override final SortedMultiset<E> multiset() { in multiset() method in SortedMultisets.ElementSet 54 return multiset; in multiset() 58 return multiset().comparator(); in comparator() 62 return multiset().subMultiset(fromElement, CLOSED, toElement, OPEN).elementSet(); in subSet() 66 return multiset().headMultiset(toElement, OPEN).elementSet(); in headSet() 70 return multiset().tailMultiset(fromElement, CLOSED).elementSet(); in tailSet() 74 return getElementOrThrow(multiset().firstEntry()); in first() [all …]
|
D | ImmutableMultiset.java | 181 Multiset<? extends E> multiset = (elements instanceof Multiset) in copyOf() local 185 return copyOfInternal(multiset); in copyOf() 193 Multiset<? extends E> multiset) { in copyOfInternal() argument 194 return copyFromEntries(multiset.entrySet()); in copyOfInternal() 230 Multiset<E> multiset = LinkedHashMultiset.create(); in copyOf() local 231 Iterators.addAll(multiset, elements); in copyOf() 232 return copyOfInternal(multiset); in copyOf() 405 final ImmutableMultiset<E> multiset; 407 EntrySetSerializedForm(ImmutableMultiset<E> multiset) { 408 this.multiset = multiset; [all …]
|
/external/libcxx/include/ |
D | set | 136 void merge(multiset<Key, C2, Allocator>& source); // C++17 138 void merge(multiset<Key, C2, Allocator>&& source); // C++17 224 class multiset 247 multiset() 252 explicit multiset(const value_compare& comp); 253 multiset(const value_compare& comp, const allocator_type& a); 255 multiset(InputIterator first, InputIterator last, 258 multiset(InputIterator first, InputIterator last, 260 multiset(const multiset& s); 261 multiset(multiset&& s) [all …]
|
/external/libcxx/test/std/containers/associative/multiset/ |
D | iterator.pass.cpp | 67 std::multiset<int> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main() 70 std::multiset<int>::iterator i; in main() 72 std::multiset<int>::const_iterator k = i; in main() 107 const std::multiset<int> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main() 112 std::multiset<int>::const_iterator i; in main() 148 std::multiset<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main() 151 std::multiset<int, std::less<int>, min_allocator<int>>::iterator i; in main() 153 std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator k = i; in main() 188 … const std::multiset<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main() 193 std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator i; in main() [all …]
|
D | merge.pass.cpp | 56 std::multiset<int> src{1, 3, 5}; in main() 57 std::multiset<int> dst{2, 4, 5}; in main() 66 typedef std::multiset<Counter<int>, throw_comparator> set_type; in main() 97 typedef std::multiset<Counter<int>, std::less<Counter<int>>> first_set_type; in main() 98 typedef std::multiset<Counter<int>, comparator> second_set_type; in main() 137 std::multiset<int> first; in main() 139 std::multiset<int> second; in main()
|
/external/libcxx/test/std/containers/associative/multiset/multiset.special/ |
D | swap_noexcept.pass.cpp | 98 typedef std::multiset<MoveOnly> C; in main() 103 typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C; in main() 107 typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C; in main() 112 typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C; in main() 118 typedef std::multiset<MoveOnly, some_comp <MoveOnly>, some_alloc <MoveOnly>> C; in main() 122 typedef std::multiset<MoveOnly, some_comp <MoveOnly>, some_alloc2<MoveOnly>> C; in main() 126 typedef std::multiset<MoveOnly, some_comp2<MoveOnly>, some_alloc <MoveOnly>> C; in main() 130 typedef std::multiset<MoveOnly, some_comp2<MoveOnly>, some_alloc2<MoveOnly>> C; in main() 135 typedef std::multiset<MoveOnly, some_comp2<MoveOnly>, some_alloc3<MoveOnly>> C; in main()
|
/external/guava/guava-testlib/src/com/google/common/collect/testing/google/ |
D | UnmodifiableCollectionTests.java | 206 public static <E> void assertMultisetIsUnmodifiable(Multiset<E> multiset, in assertMultisetIsUnmodifiable() argument 208 Multiset<E> copy = LinkedHashMultiset.create(multiset); in assertMultisetIsUnmodifiable() 209 assertCollectionsAreEquivalent(multiset, copy); in assertMultisetIsUnmodifiable() 212 assertCollectionIsUnmodifiable(multiset, sampleElement); in assertMultisetIsUnmodifiable() 214 assertCollectionsAreEquivalent(multiset, copy); in assertMultisetIsUnmodifiable() 217 multiset.add(sampleElement, 2); in assertMultisetIsUnmodifiable() 221 assertCollectionsAreEquivalent(multiset, copy); in assertMultisetIsUnmodifiable() 224 multiset.remove(sampleElement, 2); in assertMultisetIsUnmodifiable() 228 assertCollectionsAreEquivalent(multiset, copy); in assertMultisetIsUnmodifiable() 230 assertCollectionsAreEquivalent(multiset, copy); in assertMultisetIsUnmodifiable() [all …]
|
D | MultisetNavigationTester.java | 251 void expectAddFailure(SortedMultiset<E> multiset, Entry<E> entry) { in expectAddFailure() argument 253 multiset.add(entry.getElement(), entry.getCount()); in expectAddFailure() 258 multiset.add(entry.getElement()); in expectAddFailure() 263 multiset.addAll(Collections.singletonList(entry.getElement())); in expectAddFailure() 268 void expectRemoveZero(SortedMultiset<E> multiset, Entry<E> entry) { in expectRemoveZero() argument 269 assertEquals(0, multiset.remove(entry.getElement(), entry.getCount())); in expectRemoveZero() 270 assertFalse(multiset.remove(entry.getElement())); in expectRemoveZero() 271 assertFalse(multiset.elementSet().remove(entry.getElement())); in expectRemoveZero() 274 void expectSetCountFailure(SortedMultiset<E> multiset, Entry<E> entry) { in expectSetCountFailure() argument 276 multiset.setCount(entry.getElement(), multiset.count(entry.getElement())); in expectSetCountFailure() [all …]
|
/external/libcxx/test/std/containers/associative/multiset/multiset.cons/ |
D | default.pass.cpp | 24 std::multiset<int> m; in main() 30 std::multiset<int, std::less<int>, min_allocator<int>> m; in main() 37 std::multiset<int, std::less<int>, A> m; in main() 43 std::multiset<int, std::less<int>, A> m(a); in main() 49 std::multiset<int> m = {}; in main()
|