Codota Logo
Multiset.iterator
Code IndexAdd Codota to your IDE (free)

How to use
iterator
method
in
com.google.common.collect.Multiset

Best Java code snippets using com.google.common.collect.Multiset.iterator (Showing top 20 results out of 351)

  • Common ways to obtain Multiset
private void myMethod () {
Multiset m =
  • Codota IconMultimap fromMultimap;fromMultimap.keys()
  • Codota Iconnew Keys()
  • Codota Iconnew Multimaps.Keys<K, V>(this)
  • Smart code suggestions by Codota
}
origin: google/guava

@Override
public UnmodifiableIterator<E> iterator() {
 return Iterators.filter(unfiltered.iterator(), predicate);
}
origin: google/guava

@Override
public Iterator<E> iterator() {
 return Iterators.<E>unmodifiableIterator(delegate.iterator());
}
origin: wildfly/wildfly

@Override
public UnmodifiableIterator<E> iterator() {
 return Iterators.filter(unfiltered.iterator(), predicate);
}
origin: google/j2objc

@Override
public Iterator<E> iterator() {
 return Iterators.<E>unmodifiableIterator(delegate.iterator());
}
origin: wildfly/wildfly

@Override
public Iterator<E> iterator() {
 return Iterators.<E>unmodifiableIterator(delegate.iterator());
}
origin: google/guava

@Override
protected Iterator<String> newTargetIterator() {
 multimap = LinkedHashMultimap.create();
 multimap.putAll("foo", asList(2, 3));
 multimap.putAll("bar", asList(4, 5));
 multimap.putAll("foo", asList(6));
 return multimap.keys().iterator();
}
origin: google/guava

@Override
protected Iterator<String> newTargetIterator() {
 multimap = create();
 multimap.putAll("foo", asList(2, 3));
 multimap.putAll("bar", asList(4, 5));
 multimap.putAll("foo", asList(6));
 return multimap.keys().iterator();
}
origin: google/guava

@CollectionSize.Require(SEVERAL)
@CollectionFeature.Require(SUPPORTS_ITERATOR_REMOVE)
@MultisetFeature.Require(ENTRIES_ARE_VIEWS)
public void testEntryReflectsIteratorRemove() {
 initThreeCopies();
 assertEquals(3, getMultiset().count(e0()));
 Multiset.Entry<E> entry = Iterables.getOnlyElement(getMultiset().entrySet());
 assertEquals(3, entry.getCount());
 Iterator<E> itr = getMultiset().iterator();
 itr.next();
 itr.remove();
 assertEquals(2, entry.getCount());
 itr.next();
 itr.remove();
 itr.next();
 itr.remove();
 assertEquals(0, entry.getCount());
}
origin: google/guava

@GwtIncompatible // SerializableTester
public void testSerializationContainingSelf() {
 Multiset<Multiset<?>> multiset = HashMultiset.create();
 multiset.add(multiset, 2);
 Multiset<Multiset<?>> copy = SerializableTester.reserialize(multiset);
 assertEquals(2, copy.size());
 assertSame(copy, copy.iterator().next());
}
origin: google/guava

@GwtIncompatible // SerializableTester
public void testSerializationIndirectSelfReference() {
 Multiset<MultisetHolder> multiset = HashMultiset.create();
 MultisetHolder holder = new MultisetHolder(multiset);
 multiset.add(holder, 2);
 Multiset<MultisetHolder> copy = SerializableTester.reserialize(multiset);
 assertEquals(2, copy.size());
 assertSame(copy, copy.iterator().next().member);
}
origin: org.apache.mahout/mahout-core

@Override
public Iterator<Vector> iterator() {
 return Iterators.transform(trainingVectors.iterator(), new Function<HashedVector, Vector>() {
  @Override
  public Vector apply(org.apache.mahout.math.neighborhood.HashedVector input) {
   Preconditions.checkNotNull(input);
   //noinspection ConstantConditions
   return input.getVector();
  }
 });
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

@SuppressWarnings("unchecked")
@Override public Iterator<E> iterator() {
 // Safe because the returned Iterator is made unmodifiable
 return (Iterator<E>) Iterators.unmodifiableIterator(delegate.iterator());
}
origin: com.google.collections/google-collections

@SuppressWarnings("unchecked")
@Override public Iterator<E> iterator() {
 // Safe because the returned Iterator is made unmodifiable
 return (Iterator) Iterators.unmodifiableIterator(delegate.iterator());
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@SuppressWarnings("unchecked")
@Override public Iterator<E> iterator() {
 // Safe because the returned Iterator is made unmodifiable
 return (Iterator<E>) Iterators.unmodifiableIterator(delegate.iterator());
}
origin: Nextdoor/bender

@SuppressWarnings("unchecked")
@Override public Iterator<E> iterator() {
 // Safe because the returned Iterator is made unmodifiable
 return (Iterator<E>) Iterators.unmodifiableIterator(delegate.iterator());
}
origin: at.bestsolution.efxclipse.eclipse/com.google.guava

@SuppressWarnings("unchecked")
@Override public Iterator<E> iterator() {
 // Safe because the returned Iterator is made unmodifiable
 return (Iterator<E>) Iterators.unmodifiableIterator(delegate.iterator());
}
origin: com.google.gdata/gdata-core-1.0

 public Set<GoogleCookie> getCookies() {

  // Lazy flushing of expired cookies
  Iterator<GoogleCookie> cookieIter = cookies.iterator();
  while (cookieIter.hasNext()) {
   GoogleCookie cookie = cookieIter.next();
   if (cookie.hasExpired()) {
    cookieIter.remove();
   }
  }
  return cookies.elementSet();
 }
}
origin: org.ow2.authzforce/authzforce-ce-core-pdp-api

@Override
public AV getSingleElement()
{
  return size() == 1 ? elements().iterator().next() : null;
}
origin: org.ow2.authzforce/authzforce-ce-core-pdp-api

@Override
public AV getSingleElement()
{
  return size() == 1 ? elements().iterator().next() : null;
}
origin: com.google.guava/guava-tests

@GwtIncompatible // SerializableTester
public void testSerializationIndirectSelfReference() {
 Multiset<MultisetHolder> multiset = HashMultiset.create();
 MultisetHolder holder = new MultisetHolder(multiset);
 multiset.add(holder, 2);
 Multiset<MultisetHolder> copy = SerializableTester.reserialize(multiset);
 assertEquals(2, copy.size());
 assertSame(copy, copy.iterator().next().member);
}
com.google.common.collectMultisetiterator

Javadoc

Elements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially.

Popular methods of Multiset

  • add
    Adds a number of occurrences of an element to this multiset. Note that if occurrences == 1, this met
  • count
    Returns the number of occurrences of an element in this multiset (thecount of the element). Note tha
  • elementSet
    Returns the set of distinct elements contained in this multiset. The element set is backed by the sa
  • entrySet
    Returns a view of the contents of this multiset, grouped into Multiset.Entry instances, each providi
  • remove
    Removes a number of occurrences of the specified element from this multiset. If the multiset contain
  • size
    Returns the total number of all occurrences of all elements in this multiset. Note: this method does
  • isEmpty
  • clear
  • contains
    Determines whether this multiset contains the specified element.This method refines Collection#conta
  • addAll
  • setCount
    Conditionally sets the count of an element to a new value, as described in #setCount(Object,int), pr
  • equals
    Compares the specified object with this multiset for equality. Returns true if the given object is a
  • setCount,
  • equals,
  • containsAll,
  • hashCode,
  • removeAll,
  • toString,
  • stream,
  • forEachEntry,
  • retainAll

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Menu (java.awt)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now