Home
last modified time | relevance | path

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

123

/external/guava/guava-tests/test/com/google/common/collect/
DConcurrentHashMultisetTest.java55 ConcurrentHashMultiset<String> multiset; field in ConcurrentHashMultisetTest
63 multiset = new ConcurrentHashMultiset<String>(backingMap); in setUp()
73 assertEquals(COUNT, multiset.count(KEY)); in testCount_elementPresent()
81 assertEquals(0, multiset.count(KEY)); in testCount_elementAbsent()
90 assertEquals(INITIAL_COUNT, multiset.add(KEY, 0)); in testAdd_zero()
101 assertEquals(0, multiset.add(KEY, COUNT)); in testAdd_firstFewWithSuccess()
113 assertEquals(INITIAL_COUNT, multiset.add(KEY, COUNT_TO_ADD)); in testAdd_laterFewWithSuccess()
126 multiset.add(KEY, COUNT_TO_ADD); in testAdd_laterFewWithOverflow()
167 assertEquals(multiset.add(KEY, 3), 12); in testAdd_withFailures()
178 assertEquals(INITIAL_COUNT, multiset.remove(KEY, 0)); in testRemove_zeroFromSome()
[all …]
DHashMultisetTest.java39 Multiset<String> multiset = HashMultiset.create(); in testCreate() local
40 multiset.add("foo", 2); in testCreate()
41 multiset.add("bar"); in testCreate()
42 assertEquals(3, multiset.size()); in testCreate()
43 assertEquals(2, multiset.count("foo")); in testCreate()
47 Multiset<String> multiset = HashMultiset.create(50); in testCreateWithSize() local
48 multiset.add("foo", 2); in testCreateWithSize()
49 multiset.add("bar"); in testCreateWithSize()
50 assertEquals(3, multiset.size()); in testCreateWithSize()
51 assertEquals(2, multiset.count("foo")); in testCreateWithSize()
[all …]
DImmutableMultisetTest.java95 Multiset<String> multiset = ImmutableMultiset.of(); in testCreation_noArgs() local
96 assertTrue(multiset.isEmpty()); in testCreation_noArgs()
100 Multiset<String> multiset = ImmutableMultiset.of("a"); in testCreation_oneElement() local
101 assertEquals(HashMultiset.create(asList("a")), multiset); in testCreation_oneElement()
105 Multiset<String> multiset = ImmutableMultiset.of("a", "b"); in testCreation_twoElements() local
106 assertEquals(HashMultiset.create(asList("a", "b")), multiset); in testCreation_twoElements()
110 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c"); in testCreation_threeElements() local
111 assertEquals(HashMultiset.create(asList("a", "b", "c")), multiset); in testCreation_threeElements()
115 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c", "d"); in testCreation_fourElements() local
116 assertEquals(HashMultiset.create(asList("a", "b", "c", "d")), multiset); in testCreation_fourElements()
[all …]
DMultisetsTest.java51 Multiset<String> multiset = HashMultiset.create(); in testForSet() local
52 multiset.addAll(set); in testForSet()
54 assertTrue(multiset.equals(multisetView)); in testForSet()
55 assertTrue(multisetView.equals(multiset)); in testForSet()
56 assertEquals(multiset.toString(), multisetView.toString()); in testForSet()
57 assertEquals(multiset.hashCode(), multisetView.hashCode()); in testForSet()
58 assertEquals(multiset.size(), multisetView.size()); in testForSet()
62 assertEquals(multiset.elementSet(), multisetView.elementSet()); in testForSet()
63 assertEquals(multisetView.elementSet(), multiset.elementSet()); in testForSet()
92 multiset.clear(); in testForSet()
[all …]
DImmutableSortedMultisetTest.java102 Multiset<String> multiset = ImmutableSortedMultiset.of(); in testCreation_noArgs() local
103 assertTrue(multiset.isEmpty()); in testCreation_noArgs()
107 Multiset<String> multiset = ImmutableSortedMultiset.of("a"); in testCreation_oneElement() local
108 assertEquals(HashMultiset.create(asList("a")), multiset); in testCreation_oneElement()
112 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b"); in testCreation_twoElements() local
113 assertEquals(HashMultiset.create(asList("a", "b")), multiset); in testCreation_twoElements()
117 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c"); in testCreation_threeElements() local
118 assertEquals(HashMultiset.create(asList("a", "b", "c")), multiset); in testCreation_threeElements()
122 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c", "d"); in testCreation_fourElements() local
123 assertEquals(HashMultiset.create(asList("a", "b", "c", "d")), multiset); in testCreation_fourElements()
[all …]
DLinkedHashMultisetTest.java43 Multiset<String> multiset = LinkedHashMultiset.create(); in testCreate() local
44 multiset.add("foo", 2); in testCreate()
45 multiset.add("bar"); in testCreate()
46 assertEquals(3, multiset.size()); in testCreate()
47 assertEquals(2, multiset.count("foo")); in testCreate()
48 assertEquals("[foo x 2, bar]", multiset.toString()); in testCreate()
52 Multiset<String> multiset = LinkedHashMultiset.create(50); in testCreateWithSize() local
53 multiset.add("foo", 2); in testCreateWithSize()
54 multiset.add("bar"); in testCreateWithSize()
55 assertEquals(3, multiset.size()); in testCreateWithSize()
[all …]
DConcurrentHashMultisetBasherTest.java65 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 …]
DTreeMultisetTest.java49 TreeMultiset<String> multiset = TreeMultiset.create(); in testCreate() local
50 multiset.add("foo", 2); in testCreate()
51 multiset.add("bar"); in testCreate()
52 assertEquals(3, multiset.size()); in testCreate()
53 assertEquals(2, multiset.count("foo")); in testCreate()
54 assertEquals(Ordering.natural(), multiset.comparator()); in testCreate()
55 assertEquals("[bar, foo x 2]", multiset.toString()); in testCreate()
59 Multiset<String> multiset = TreeMultiset.create(Collections.reverseOrder()); in testCreateWithComparator() local
60 multiset.add("foo", 2); in testCreateWithComparator()
61 multiset.add("bar"); in testCreateWithComparator()
[all …]
DSimpleAbstractMultisetTest.java43 Multiset<String> multiset = new NoRemoveMultiset<String>() { in testFastAddAllMultiset() local
52 multiset.addAll(adds); in testFastAddAllMultiset()
57 Multiset<String> multiset = new NoRemoveMultiset<String>(); in testRemoveUnsupported() local
58 multiset.add("a"); in testRemoveUnsupported()
60 multiset.remove("a"); in testRemoveUnsupported()
63 assertTrue(multiset.contains("a")); in testRemoveUnsupported()
DConstraintsTest.java265 Multiset<String> multiset = HashMultiset.create(asList("foo", "bar")); in testConstrainedMultisetLegal() local
267 multiset, TEST_CONSTRAINT); in testConstrainedMultisetLegal()
268 multiset.add(TEST_ELEMENT); in testConstrainedMultisetLegal()
272 assertTrue(multiset.equals(constrained)); in testConstrainedMultisetLegal()
273 assertTrue(constrained.equals(multiset)); in testConstrainedMultisetLegal()
274 assertEquals(multiset.toString(), constrained.toString()); in testConstrainedMultisetLegal()
275 assertEquals(multiset.hashCode(), constrained.hashCode()); in testConstrainedMultisetLegal()
276 ASSERT.that(multiset).hasContentsAnyOrder( in testConstrainedMultisetLegal()
283 ASSERT.that(multiset).hasContentsAnyOrder("bar", TEST_ELEMENT, "qux", "cat", "dog"); in testConstrainedMultisetLegal()
288 Multiset<String> multiset = HashMultiset.create(asList("foo", "bar")); in testConstrainedMultisetIllegal() local
[all …]
/external/guava/guava/src/com/google/common/collect/
DImmutableMultiset.java191 Multiset<? extends E> multiset = (elements instanceof Multiset) in copyOf() local
195 return copyOfInternal(multiset); in copyOf()
203 Multiset<? extends E> multiset) { in copyOfInternal() argument
204 return copyFromEntries(multiset.entrySet()); in copyOfInternal()
239 Multiset<E> multiset = LinkedHashMultiset.create(); in copyOf() local
240 Iterators.addAll(multiset, elements); in copyOf()
241 return copyOfInternal(multiset); in copyOf()
365 transient final ImmutableMultiset<E> multiset; field in EntrySet
367 public EntrySet(ImmutableMultiset<E> multiset) { in EntrySet() argument
368 this.multiset = multiset; in EntrySet()
[all …]
DMultisets.java70 Multiset<? extends E> multiset) { in unmodifiableMultiset() argument
71 if (multiset instanceof UnmodifiableMultiset || in unmodifiableMultiset()
72 multiset instanceof ImmutableMultiset) { in unmodifiableMultiset()
75 Multiset<E> result = (Multiset<E>) multiset; in unmodifiableMultiset()
78 return new UnmodifiableMultiset<E>(checkNotNull(multiset)); in unmodifiableMultiset()
88 ImmutableMultiset<E> multiset) { in unmodifiableMultiset() argument
89 return checkNotNull(multiset); in unmodifiableMultiset()
385 @Override Multiset<E> multiset() { in entrySet()
702 static boolean equalsImpl(Multiset<?> multiset, @Nullable Object object) {
703 if (object == multiset) {
[all …]
DSortedMultisets.java44 @Override abstract SortedMultiset<E> multiset(); in multiset() method in SortedMultisets.ElementSet
47 return multiset().comparator(); in comparator()
51 return multiset().subMultiset(fromElement, BoundType.CLOSED, toElement, in subSet()
56 return multiset().headMultiset(toElement, BoundType.OPEN).elementSet(); in headSet()
60 return multiset().tailMultiset(fromElement, BoundType.CLOSED) in tailSet()
65 return getElementOrThrow(multiset().firstEntry()); in first()
69 return getElementOrThrow(multiset().lastEntry()); in last()
105 @Override SortedMultiset<E> multiset() { in elementSet()
166 @Override Multiset<E> multiset() { in createEntrySet()
DSortedIterables.java124 TreeMultiset<E> multiset = TreeMultiset.create(comparator); in sortedCounts() local
125 Iterators.addAll(multiset, elements); in sortedCounts()
126 return multiset.entrySet(); in sortedCounts()
136 Multiset<E> multiset = (Multiset<E>) elements; in sortedCounts() local
138 return multiset.entrySet(); in sortedCounts()
140 List<Multiset.Entry<E>> entries = Lists.newArrayList(multiset.entrySet()); in sortedCounts()
182 TreeMultiset<E> multiset = TreeMultiset.create(comparator); in sortedCounts() local
183 Iterables.addAll(multiset, elements); in sortedCounts()
184 return multiset.entrySet(); in sortedCounts()
DSerialization.java105 Multiset<E> multiset, ObjectOutputStream stream) throws IOException { in writeMultiset() argument
106 int entryCount = multiset.entrySet().size(); in writeMultiset()
108 for (Multiset.Entry<E> entry : multiset.entrySet()) { in writeMultiset()
119 Multiset<E> multiset, ObjectInputStream stream) in populateMultiset() argument
122 populateMultiset(multiset, stream, distinctElements); in populateMultiset()
131 Multiset<E> multiset, ObjectInputStream stream, int distinctElements) in populateMultiset() argument
137 multiset.add(element, count); in populateMultiset()
DHashMultiset.java65 HashMultiset<E> multiset = in create() local
67 Iterables.addAll(multiset, elements); in create()
68 return multiset; in create()
DLinkedHashMultiset.java72 LinkedHashMultiset<E> multiset = in create() local
74 Iterables.addAll(multiset, elements); in create()
75 return multiset; in create()
/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 …]
DSortedMultisetTestSuiteBuilder.java177 SortedMultiset<E> multiset = in createSubMultisetSuite() local
183 multiset = in createSubMultisetSuite()
184 multiset.tailMultiset(firstInclusive, BoundType.CLOSED); in createSubMultisetSuite()
186 multiset = multiset.tailMultiset(firstExclusive, BoundType.OPEN); in createSubMultisetSuite()
190 multiset = multiset.headMultiset(lastInclusive, BoundType.CLOSED); in createSubMultisetSuite()
192 multiset = multiset.headMultiset(lastExclusive, BoundType.OPEN); in createSubMultisetSuite()
195 return multiset; in createSubMultisetSuite()
/external/stlport/stlport/stl/
D_set.h216 class multiset in _STLP_CREATE_ITERATOR_TRAITS()
218 : public __stlport_class<multiset<_Key, _Compare, _Alloc> > in _STLP_CREATE_ITERATOR_TRAITS()
221 typedef multiset<_Key, _Compare, _Alloc> _Self; in _STLP_CREATE_ITERATOR_TRAITS()
258 explicit multiset(const _Compare& __comp = _Compare(), in _STLP_CREATE_ITERATOR_TRAITS()
261 multiset() in _STLP_CREATE_ITERATOR_TRAITS()
263 explicit multiset(const _Compare& __comp) in _STLP_CREATE_ITERATOR_TRAITS()
265 multiset(const _Compare& __comp, const allocator_type& __a) in _STLP_CREATE_ITERATOR_TRAITS()
271 multiset(_InputIterator __first, _InputIterator __last) in _STLP_CREATE_ITERATOR_TRAITS()
276 multiset(_InputIterator __first, _InputIterator __last, in _STLP_CREATE_ITERATOR_TRAITS()
282 multiset(_InputIterator __first, _InputIterator __last, in _STLP_CREATE_ITERATOR_TRAITS()
[all …]
/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/
DHashMultiset.java61 HashMultiset<E> multiset = in create() local
63 Iterables.addAll(multiset, elements); in create()
64 return multiset; in create()
DLinkedHashMultiset.java68 LinkedHashMultiset<E> multiset = in create() local
70 Iterables.addAll(multiset, elements); in create()
71 return multiset; in create()
DEnumMultiset.java49 EnumMultiset<E> multiset = new EnumMultiset<E>(iterator.next().getDeclaringClass()); in create() local
50 Iterables.addAll(multiset, elements); in create()
51 return multiset; in create()
/external/guava/guava-gwt/src/com/google/common/collect/
DMultiset_CustomFieldSerializerBase.java47 SerializationStreamReader reader, Multiset<Object> multiset) in populate() argument
53 multiset.add(element, count); in populate()
55 return multiset; in populate()

123