Tabnine Logo
Multiset.iterator
Code IndexAdd Tabnine 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)

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

  • Start an intent from android
  • getSystemService (Context)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now