/external/guava/guava-tests/test/com/google/common/collect/ |
HashMultisetTest.java | 34 @Override protected <E> Multiset<E> create() { 39 Multiset<String> multiset = HashMultiset.create(); local 40 multiset.add("foo", 2); 41 multiset.add("bar"); 42 assertEquals(3, multiset.size()); 43 assertEquals(2, multiset.count("foo")); 47 Multiset<String> multiset = HashMultiset.create(50); local 48 multiset.add("foo", 2) 55 Multiset<String> multiset local 63 Multiset<Multiset<?>> multiset = HashMultiset.create(); local 81 Multiset<MultisetHolder> multiset = HashMultiset.create(); local [all...] |
ConcurrentHashMultisetWithChmTest.java | 28 @Override protected <E> Multiset<E> create() {
|
MultisetsTest.java | 51 Multiset<String> multiset = HashMultiset.create(); local 52 multiset.addAll(set); 53 Multiset<String> multisetView = Multisets.forSet(set); 54 assertTrue(multiset.equals(multisetView)); 55 assertTrue(multisetView.equals(multiset)); 56 assertEquals(multiset.toString(), multisetView.toString()); 57 assertEquals(multiset.hashCode(), multisetView.hashCode()); 58 assertEquals(multiset.size(), multisetView.size()); 62 assertEquals(multiset.elementSet(), multisetView.elementSet()) 104 Multiset<String> multiset = HashMultiset.create(); local 132 TreeMultiset<String> multiset local 140 Multiset<String> multiset = HashMultiset.create(); local 148 Multiset<String> multiset = HashMultiset.create(); local 185 Multiset<String> multiset = local 193 Multiset<String> multiset = local 202 Multiset<String> multiset = local 210 Multiset<String> multiset = local 230 Multiset<String> multiset = HashMultiset.create( local [all...] |
ConcurrentHashMultisetWithCslmTest.java | 24 * {@link ConcurrentSkipListMap}. User code cannot create such a multiset, since 35 @Override protected <E> Multiset<E> create() {
|
SimpleAbstractMultisetTest.java | 20 import com.google.common.collect.Multiset.Entry; 37 @Override protected <E> Multiset<E> create() { 43 Multiset<String> multiset = new NoRemoveMultiset<String>() { local 52 multiset.addAll(adds); 57 Multiset<String> multiset = new NoRemoveMultiset<String>(); local 58 multiset.add("a"); 60 multiset.remove("a"); 63 assertTrue(multiset.contains("a")) [all...] |
ImmutableMultisetTest.java | 59 @Override protected Multiset<String> create(String[] elements) { 70 @Override protected Multiset<String> create(String[] elements) { 95 Multiset<String> multiset = ImmutableMultiset.of(); local 96 assertTrue(multiset.isEmpty()); 100 Multiset<String> multiset = ImmutableMultiset.of("a"); local 101 assertEquals(HashMultiset.create(asList("a")), multiset); 105 Multiset<String> multiset = ImmutableMultiset.of("a", "b") local 110 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c"); local 115 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c", "d"); local 120 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "c", "d", "e"); local 126 Multiset<String> multiset = ImmutableMultiset.of( local 133 Multiset<String> multiset = ImmutableMultiset.of( local 142 Multiset<String> multiset = ImmutableMultiset.copyOf(array); local 148 Multiset<String> multiset = ImmutableMultiset.copyOf(array); local 154 Multiset<String[]> multiset = ImmutableMultiset.<String[]>of(array); local 171 Multiset<String> multiset = ImmutableMultiset.copyOf(c); local 177 Multiset<String> multiset = ImmutableMultiset.copyOf(c); local 183 Multiset<String> multiset = ImmutableMultiset.copyOf(c); local 197 Multiset<String> multiset = ImmutableMultiset.copyOf(c); local 203 Multiset<String> multiset = ImmutableMultiset.copyOf(c); local 209 Multiset<String> multiset = ImmutableMultiset.copyOf(c); local 223 Multiset<String> multiset = ImmutableMultiset.copyOf(iterator); local 229 Multiset<String> multiset = ImmutableMultiset.copyOf(iterator); local 235 Multiset<String> multiset = ImmutableMultiset.copyOf(iterator); local 258 Multiset<String> multiset = ImmutableMultiset.copyOf(iterable); local 279 ImmutableMultiset<String> multiset = new ImmutableMultiset.Builder<String>() local 291 ImmutableMultiset<String> multiset = new ImmutableMultiset.Builder<String>() local 301 ImmutableMultiset<String> multiset = new ImmutableMultiset.Builder<String>() local 311 ImmutableMultiset<String> multiset = new ImmutableMultiset.Builder<String>() local 318 ImmutableMultiset<String> multiset = new ImmutableMultiset.Builder<String>() local 328 ImmutableMultiset<String> multiset = new ImmutableMultiset.Builder<String>() local 447 Multiset<String> multiset = ImmutableMultiset.of("a", "b", "a"); local 452 ImmutableMultiset<String> multiset local 462 ImmutableMultiset<String> multiset local [all...] |
ImmutableSortedMultisetTest.java | 56 protected Multiset<String> create(String[] elements) { 70 protected Multiset<String> create(String[] elements) { 102 Multiset<String> multiset = ImmutableSortedMultiset.of(); local 103 assertTrue(multiset.isEmpty()); 107 Multiset<String> multiset = ImmutableSortedMultiset.of("a"); local 108 assertEquals(HashMultiset.create(asList("a")), multiset); 112 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b") local 117 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c"); local 122 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c", "d"); local 127 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c", "d", "e"); local 132 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c", "d", "e", "f"); local 137 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "c", "d", "e", "f", "g"); local 143 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(array); local 149 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(array); local 163 Multiset<String[]> multiset = ImmutableSortedMultiset.orderedBy(comparator).add(array).build(); local 180 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c); local 186 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c); local 192 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c); local 206 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c); local 212 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c); local 218 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(c); local 232 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(iterator); local 238 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(iterator); local 244 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(iterator); local 268 Multiset<String> multiset = ImmutableSortedMultiset.copyOf(iterable); local 289 ImmutableSortedMultiset<String> multiset = local 297 ImmutableSortedMultiset<String> multiset = local 305 ImmutableSortedMultiset<String> multiset = local 312 ImmutableSortedMultiset<String> multiset = local 318 ImmutableSortedMultiset<String> multiset = local 325 ImmutableSortedMultiset<String> multiset = local 440 Multiset<String> multiset = ImmutableSortedMultiset.of("a", "b", "a"); local 445 ImmutableSortedMultiset<String> multiset = ImmutableSortedMultiset.of("a", "a", "b", "b", "b"); local [all...] |
MultisetCollectionTest.java | 42 * Collection tests for {@link Multiset} implementations. 69 protected Multiset<String> create(String[] elements) { 88 protected Multiset<String> create(String[] elements) { 89 Multiset<String> result = TreeMultiset.create(Ordering.natural().nullsFirst()); 148 @Override protected Multiset<String> create(String[] elements) { 156 @Override protected Multiset<String> create(String[] elements) { 169 @Override protected Multiset<String> create(String[] elements) { 182 @Override protected Multiset<String> create(String[] elements) { 190 @Override protected Multiset<String> create(String[] elements) { 198 @Override protected Multiset<AnEnum> create(AnEnum[] elements) [all...] |
EnumMultisetTest.java | 43 Multiset<Color> ms = EnumMultiset.create(Color.class); 53 Multiset<Color> ms = EnumMultiset.create( 69 Multiset<Color> ms = EnumMultiset.create(Color.class); 78 Multiset<Color> ms = EnumMultiset.create( 84 Multiset<Color> ms = EnumMultiset.create(Color.class);
|
ForwardingMultisetTest.java | 45 private final Multiset<T> backingCollection; 47 StandardImplForwardingMultiset(Multiset<T> backingMultiset) { 51 @Override protected Multiset<T> delegate() { 139 protected Multiset<String> forward; 148 @Override protected Multiset<String> create(String[] elements) { 159 @Override protected Multiset<String> create(String[] elements) { 171 * Returns a Multiset that throws an exception on any attempt to use a 176 final Multiset<String> inner = 179 @Override protected Multiset<String> delegate() { 275 final Multiset<String> multiset = createProxyInstance(Multiset.class) local [all...] |
LinkedHashMultisetTest.java | 38 @Override protected <E> Multiset<E> create() { 43 Multiset<String> multiset = LinkedHashMultiset.create(); local 44 multiset.add("foo", 2); 45 multiset.add("bar"); 46 assertEquals(3, multiset.size()); 47 assertEquals(2, multiset.count("foo")); 48 assertEquals("[foo x 2, bar]", multiset.toString()); 52 Multiset<String> multiset = LinkedHashMultiset.create(50) local 61 Multiset<String> multiset local [all...] |
AbstractMultisetTest.java | 23 import com.google.common.collect.Multiset.Entry; 34 * Common tests for a {@link Multiset}. 41 @Override protected abstract <E> Multiset<E> create(); 43 protected Multiset<String> ms; 52 * Validates that multiset size returned by {@code size()} is the same as the 53 * size generated by summing the counts of all multiset entries. 55 protected void assertSize(Multiset<String> multiset) { 57 for (Multiset.Entry<String> entry : multiset.entrySet()) [all...] |
/external/guava/guava-testlib/src/com/google/common/collect/testing/google/ |
AbstractMultisetTester.java | 20 import com.google.common.collect.Multiset; 24 * Base class for multiset collection tests. 30 protected final Multiset<E> getMultiset() { 31 return (Multiset<E>) collection;
|
TestMultisetGenerator.java | 20 import com.google.common.collect.Multiset; 31 Multiset<E> create(Object... elements);
|
TestStringMultisetGenerator.java | 20 import com.google.common.collect.Multiset; 41 public Multiset<String> create(Object... elements) { 50 protected abstract Multiset<String> create(String[] elements);
|
TestEnumMultisetGenerator.java | 20 import com.google.common.collect.Multiset; 43 public Multiset<AnEnum> create(Object... elements) { 52 protected abstract Multiset<AnEnum> create(AnEnum[] elements);
|
MultisetReadsTester.java | 25 import com.google.common.collect.Multiset; 35 * A generic JUnit test which tests multiset-specific read operations. 44 assertEquals("multiset.count(missing) didn't return 0", 50 assertEquals("multiset.count(present) didn't return 1", 57 assertEquals("multiset.count(thriceContained) didn't return 3", 62 assertEquals("multiset.count(null) didn't return 0", 67 assertEquals("multiset.count(wrongType) didn't return 0", 73 assertTrue("multiset.elementSet().contains(present) returned false", 79 assertTrue("multiset.entrySet() didn't contain [present, 1]", 85 assertFalse("multiset.entrySet() contains [missing, 0]" [all...] |
/external/guava/guava-gwt/src/com/google/common/collect/ |
Multiset_CustomFieldSerializerBase.java | 24 * This class contains static utility methods for writing {@code Multiset} GWT 26 * {@link #serialize(SerializationStreamWriter, Multiset)} and to either 28 * {@link #populate(SerializationStreamReader, Multiset)}. 46 static Multiset<Object> populate( 47 SerializationStreamReader reader, Multiset<Object> multiset) 53 multiset.add(element, count); 55 return multiset; 58 static void serialize(SerializationStreamWriter writer, Multiset<?> instance) 62 for (Multiset.Entry<?> entry : instance.entrySet()) [all...] |
/external/guava/guava/src/com/google/common/collect/ |
Multisets.java | 40 import com.google.common.collect.Multiset.Entry; 45 * Multiset} instances. 57 * Returns an unmodifiable view of the specified multiset. Query operations on 58 * the returned multiset "read through" to the specified multiset, and 59 * attempts to modify the returned multiset result in an 62 * <p>The returned multiset will be serializable if the specified multiset is 65 * @param multiset the multiset for which an unmodifiable view is to b [all...] |
SortedIterables.java | 21 import com.google.common.collect.Multiset.Entry; 82 if (elements instanceof Multiset) { 83 elements = ((Multiset<E>) elements).elementSet(); 119 * Returns a collection of multiset entries representing the counts of the distinct elements, in 122 public static <E> Collection<Multiset.Entry<E>> sortedCounts( 124 TreeMultiset<E> multiset = TreeMultiset.create(comparator); local 125 Iterators.addAll(multiset, elements); 126 return multiset.entrySet(); 130 * Returns a collection of multiset entries representing the counts of the distinct elements, in 133 public static <E> Collection<Multiset.Entry<E>> sortedCounts 136 Multiset<E> multiset = (Multiset<E>) elements; local 182 TreeMultiset<E> multiset = TreeMultiset.create(comparator); local [all...] |
ImmutableMultiset.java | 22 import com.google.common.collect.Multiset.Entry; 37 * An immutable hash-based multiset. Does not permit null elements. 41 * multiset contains multiple instances of an element, those instances are 52 implements Multiset<E> { 55 * Returns the empty immutable multiset. 63 * Returns an immutable multiset containing a single element. 74 * Returns an immutable multiset containing the given elements, in order. 85 * Returns an immutable multiset containing the given elements, in order. 96 * Returns an immutable multiset containing the given elements, in order. 107 * Returns an immutable multiset containing the given elements, in order 191 Multiset<? extends E> multiset = (elements instanceof Multiset) local 239 Multiset<E> multiset = LinkedHashMultiset.create(); local 365 transient final ImmutableMultiset<E> multiset; field in class:EntrySet 443 final ImmutableMultiset<E> multiset; field in class:EntrySet.EntrySetSerializedForm 474 LinkedHashMultiset<Object> multiset = local 601 Multiset<? extends E> multiset = Multisets.cast(elements); local [all...] |
ConcurrentHashMultiset.java | 44 * A multiset that supports concurrent modifications and that provides atomic versions of most 45 * {@code Multiset} operations (exceptions where noted). Null elements are not supported. 88 * <p>This implementation is highly efficient when {@code elements} is itself a {@link Multiset}. 90 * @param elements the elements that the multiset should contain 93 ConcurrentHashMultiset<E> multiset = ConcurrentHashMultiset.create(); local 94 Iterables.addAll(multiset, elements); 95 return multiset; 104 * multiset do not count as map updates at all, since we're usually just mutating the value 109 * <p>The returned multiset is serializable but any serialization caveats 130 * @param countMap backing map for storing the elements in the multiset an [all...] |
AbstractMultiset.java | 32 * This class provides a skeletal implementation of the {@link Multiset} 33 * interface. A new multiset implementation can be created easily by extending 34 * this class and implementing the {@link Multiset#entrySet()} method, plus 36 * {@link #remove(Object, int)} to enable modifications to the multiset. 39 * the set returned by {@link Multiset#entrySet()}, as do many methods acting on 48 implements Multiset<E> { 114 * is itself a {@link Multiset}. 146 * Creates a new instance of this multiset's element set, which will be 155 Multiset<E> multiset() { method in class:AbstractMultiset.ElementSet 172 @Override Multiset<E> multiset() { method in class:AbstractMultiset.EntrySet [all...] |
ForwardingMultiset.java | 30 * A multiset which forwards all its method calls to another multiset. 32 * backing multiset as desired per the <a 53 implements Multiset<E> { 58 @Override protected abstract Multiset<E> delegate(); 235 * A sensible implementation of {@link Multiset#elementSet} in terms of the 252 Multiset<E> multiset() { method in class:ForwardingMultiset.StandardElementSet
|
SortedMultisets.java | 20 import com.google.common.collect.Multiset.Entry; 44 @Override abstract SortedMultiset<E> multiset(); method in class:SortedMultisets.ElementSet 47 return multiset().comparator(); 51 return multiset().subMultiset(fromElement, BoundType.CLOSED, toElement, 56 return multiset().headMultiset(toElement, BoundType.OPEN).elementSet(); 60 return multiset().tailMultiset(fromElement, BoundType.CLOSED) 65 return getElementOrThrow(multiset().firstEntry()); 69 return getElementOrThrow(multiset().lastEntry()); 81 * A skeleton implementation of a descending multiset. Only needs 105 @Override SortedMultiset<E> multiset() { [all...] |