Home
last modified time | relevance | path

Searched refs:multiset (Results 1 – 25 of 116) sorted by relevance

12345

/external/guava/guava-tests/test/com/google/common/collect/
DConcurrentHashMultisetTest.java80 ConcurrentHashMultiset<String> multiset;
88 multiset = new ConcurrentHashMultiset<String>(backingMap);
98 assertEquals(COUNT, multiset.count(KEY));
106 assertEquals(0, multiset.count(KEY));
115 assertEquals(INITIAL_COUNT, multiset.add(KEY, 0));
126 assertEquals(0, multiset.add(KEY, COUNT));
138 assertEquals(INITIAL_COUNT, multiset.add(KEY, COUNT_TO_ADD));
151 multiset.add(KEY, COUNT_TO_ADD);
192 assertEquals(multiset.add(KEY, 3), 12);
203 assertEquals(INITIAL_COUNT, multiset.remove(KEY, 0));
[all …]
DHashMultisetTest.java71 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 …]
DImmutableMultisetTest.java134 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 …]
DImmutableSortedMultisetTest.java121 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 …]
DLinkedHashMultisetTest.java85 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 …]
DMultisetsTest.java64 TreeMultiset<String> multiset in testNewTreeMultisetComparator() local
66 multiset.add("bar", 3); in testNewTreeMultisetComparator()
67 multiset.add("foo", 2); in testNewTreeMultisetComparator()
68 ASSERT.that(multiset).has().exactly("foo", "foo", "bar", "bar", "bar").inOrder(); in testNewTreeMultisetComparator()
72 Multiset<String> multiset = HashMultiset.create(); in testRetainOccurrencesEmpty() local
75 assertFalse(Multisets.retainOccurrences(multiset, toRetain)); in testRetainOccurrencesEmpty()
76 ASSERT.that(multiset).isEmpty(); in testRetainOccurrencesEmpty()
80 Multiset<String> multiset = HashMultiset.create(); in testRemoveOccurrencesEmpty() local
83 assertFalse(Multisets.retainOccurrences(multiset, toRemove)); in testRemoveOccurrencesEmpty()
84 assertTrue(multiset.isEmpty()); in testRemoveOccurrencesEmpty()
[all …]
DConcurrentHashMultisetBasherTest.java60 final ConcurrentHashMultiset<String> multiset = new ConcurrentHashMultiset<String>(map); in testAddAndRemove() local
69 futures.add(pool.submit(new MutateTask(multiset, keys))); in testAddAndRemove()
83 return multiset.count(key); in testAddAndRemove()
98 private final ConcurrentHashMultiset<String> multiset; field in ConcurrentHashMultisetBasherTest.MutateTask
102 private MutateTask(ConcurrentHashMultiset<String> multiset, ImmutableList<String> keys) { in MutateTask() argument
103 this.multiset = multiset; in MutateTask()
119 multiset.add(key, delta); in call()
125 int oldValue = multiset.setCount(key, newValue); in call()
131 int oldValue = multiset.count(key); in call()
132 if (multiset.setCount(key, oldValue, newValue)) { in call()
[all …]
DTreeMultisetTest.java120 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/
DImmutableMultisetTest.java42 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 …]
DHashMultisetTest.java46 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 …]
DLinkedHashMultisetTest.java61 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 …]
DMultisetsTest.java62 TreeMultiset<String> multiset in testNewTreeMultisetComparator() local
64 multiset.add("bar", 3); in testNewTreeMultisetComparator()
65 multiset.add("foo", 2); in testNewTreeMultisetComparator()
66 ASSERT.that(multiset).has().exactly("foo", "foo", "bar", "bar", "bar").inOrder(); in testNewTreeMultisetComparator()
70 Multiset<String> multiset = HashMultiset.create(); in testRetainOccurrencesEmpty() local
73 assertFalse(Multisets.retainOccurrences(multiset, toRetain)); in testRetainOccurrencesEmpty()
74 ASSERT.that(multiset).isEmpty(); in testRetainOccurrencesEmpty()
78 Multiset<String> multiset = HashMultiset.create(); in testRemoveOccurrencesEmpty() local
81 assertFalse(Multisets.retainOccurrences(multiset, toRemove)); in testRemoveOccurrencesEmpty()
82 assertTrue(multiset.isEmpty()); in testRemoveOccurrencesEmpty()
[all …]
DTreeMultisetTest.java40 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 …]
DSimpleAbstractMultisetTest.java42 Multiset<String> multiset = new NoRemoveMultiset<String>() { in testFastAddAllMultiset() local
51 multiset.addAll(adds); in testFastAddAllMultiset()
56 Multiset<String> multiset = new NoRemoveMultiset<String>(); in testRemoveUnsupported() local
57 multiset.add("a"); in testRemoveUnsupported()
59 multiset.remove("a"); in testRemoveUnsupported()
62 assertTrue(multiset.contains("a")); in testRemoveUnsupported()
/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/
DSortedMultisets.java47 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 …]
DImmutableMultiset.java181 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/guava/guava/src/com/google/common/collect/
DSortedMultisets.java49 private final SortedMultiset<E> multiset; field in SortedMultisets.ElementSet
51 ElementSet(SortedMultiset<E> multiset) { in ElementSet() argument
52 this.multiset = multiset; in ElementSet()
55 @Override final SortedMultiset<E> multiset() { in multiset() method in SortedMultisets.ElementSet
56 return multiset; in multiset()
60 return multiset().comparator(); in comparator()
64 return multiset().subMultiset(fromElement, CLOSED, toElement, OPEN).elementSet(); in subSet()
68 return multiset().headMultiset(toElement, OPEN).elementSet(); in headSet()
72 return multiset().tailMultiset(fromElement, CLOSED).elementSet(); in tailSet()
76 return getElementOrThrow(multiset().firstEntry()); in first()
[all …]
DMultisets.java73 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()
802 static boolean equalsImpl(Multiset<?> multiset, @Nullable Object object) {
803 if (object == multiset) {
814 if (multiset.size() != that.size()
[all …]
DImmutableMultiset.java182 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/libcxx/test/std/containers/associative/multiset/
Diterator.pass.cpp65 std::multiset<int> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main()
68 std::multiset<int>::iterator i; in main()
70 std::multiset<int>::const_iterator k = i; in main()
105 const std::multiset<int> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main()
110 std::multiset<int>::const_iterator i; in main()
146 std::multiset<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main()
149 std::multiset<int, std::less<int>, min_allocator<int>>::iterator i; in main()
151 std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator k = i; in main()
186 … const std::multiset<int, std::less<int>, min_allocator<int>> m(ar, ar+sizeof(ar)/sizeof(ar[0])); in main()
191 std::multiset<int, std::less<int>, min_allocator<int>>::const_iterator i; in main()
[all …]
/external/libcxx/include/
Dset204 class multiset
226 multiset()
231 explicit multiset(const value_compare& comp);
232 multiset(const value_compare& comp, const allocator_type& a);
234 multiset(InputIterator first, InputIterator last,
237 multiset(InputIterator first, InputIterator last,
239 multiset(const multiset& s);
240 multiset(multiset&& s)
244 explicit multiset(const allocator_type& a);
245 multiset(const multiset& s, const allocator_type& a);
[all …]
/external/guava/guava-testlib/src/com/google/common/collect/testing/google/
DUnmodifiableCollectionTests.java206 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 …]
DMultisetNavigationTester.java251 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/
Ddefault_noexcept.pass.cpp37 typedef std::multiset<MoveOnly> C; in main()
41 typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C; in main()
45 typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C; in main()
49 typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C; in main()
Dmove_assign_noexcept.pass.cpp37 typedef std::multiset<MoveOnly> C; in main()
41 typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C; in main()
45 typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C; in main()
49 typedef std::multiset<MoveOnly, some_comp<MoveOnly>> C; in main()

12345