Interface SetMultimap<K,​V>

All Superinterfaces:
Multimap<K,​V>
All Known Subinterfaces:
ImmutableSetIterableMultimap<K,​V>, ImmutableSetMultimap<K,​V>, ImmutableSortedSetMultimap<K,​V>, MutableSetIterableMultimap<K,​V>, MutableSetMultimap<K,​V>, MutableSortedSetMultimap<K,​V>, SortedSetMultimap<K,​V>, UnsortedSetMultimap<K,​V>
All Known Implementing Classes:
AbstractMutableSetMultimap, ImmutableSetMultimapImpl, ImmutableSortedSetMultimapImpl, MultiReaderUnifiedSetMultimap, SynchronizedPutTreeSortedSetMultimap, SynchronizedPutUnifiedSetMultimap, SynchronizedSetMultimap, SynchronizedSortedSetMultimap, TreeSortedSetMultimap, UnifiedSetMultimap, UnifiedSetWithHashingStrategyMultimap

public interface SetMultimap<K,​V>
extends Multimap<K,​V>
  • Method Details

    • newEmpty

      SetMultimap<K,​V> newEmpty()
      Description copied from interface: Multimap
      Creates a new instance of the same implementation type, using the default capacity and growth parameters.
      Specified by:
      newEmpty in interface Multimap<K,​V>
    • get

      SetIterable<V> get​(K key)
      Description copied from interface: Multimap
      Returns a view of all values associated with the given key.

      If the given key does not exist, an empty RichIterable is returned.

      Specified by:
      get in interface Multimap<K,​V>
      Parameters:
      key - the key to search for
    • flip

      SetMultimap<V,​K> flip()
      Description copied from interface: Multimap
      Given a Multimap from Domain -> Range return a multimap from Range -> Domain.
      Specified by:
      flip in interface Multimap<K,​V>
    • selectKeysValues

      SetMultimap<K,​V> selectKeysValues​(Predicate2<? super K,​? super V> predicate)
      Description copied from interface: Multimap
      Returns all elements of the source multimap that satisfies the predicate. This method is also commonly called filter.
      e.g.
       return multimap.selectKeysValues(new Predicate2<Integer, Person>()
       {
           public boolean accept(Integer age, Person person)
           {
               return (age >= 18)
                        && (person.getAddress().getCity().equals("Metuchen"));
           }
       });
       
      Specified by:
      selectKeysValues in interface Multimap<K,​V>
      Parameters:
      predicate - a Predicate2 to use as the select criteria
      Returns:
      Multimap, which contains elements as a result of the select criteria
    • rejectKeysValues

      SetMultimap<K,​V> rejectKeysValues​(Predicate2<? super K,​? super V> predicate)
      Description copied from interface: Multimap
      Returns all elements of the source multimap that don't satisfy the predicate.
      e.g.
       return multimap.rejectKeysValues(new Predicate2<Integer, Person>()
       {
           public boolean accept(Integer age, Person person)
           {
               return (age >= 18)
                        && (person.getAddress().getCity().equals("Metuchen"));
           }
       });
       
      Specified by:
      rejectKeysValues in interface Multimap<K,​V>
      Parameters:
      predicate - a Predicate2 to use as the reject criteria
      Returns:
      Multimap, which contains elements that don't satisfy the predicate
    • selectKeysMultiValues

      SetMultimap<K,​V> selectKeysMultiValues​(Predicate2<? super K,​? super Iterable<V>> predicate)
      Description copied from interface: Multimap
      Returns all elements of the source multimap that satisfies the predicate. This method is also commonly called filter.
      e.g.
       return multimap.selectKeysMultiValues(new Predicate2<Integer, Iterable<Person>>()
       {
           public boolean accept(Integer age, Iterable<Person> values)
           {
               return (age >= 18)
                        && ((RichIterable<Person>)values.size() >= 2);
           }
       });
       
      Specified by:
      selectKeysMultiValues in interface Multimap<K,​V>
      Parameters:
      predicate - a Predicate2 to use as the select criteria
      Returns:
      Multimap, which contains elements as a result of the select criteria
    • rejectKeysMultiValues

      SetMultimap<K,​V> rejectKeysMultiValues​(Predicate2<? super K,​? super Iterable<V>> predicate)
      Description copied from interface: Multimap
      Returns all elements of the source multimap that don't satisfy the predicate.
      e.g.
       return multimap.rejectKeysMultiValues(new Predicate2<Integer, Iterable<Person>>()
       {
           public boolean accept(Integer age, Iterable<Person> values)
           {
               return (age >= 18)
                        && ((RichIterable<Person>)values.size() >= 2);
           }
       });
       
      Specified by:
      rejectKeysMultiValues in interface Multimap<K,​V>
      Parameters:
      predicate - a Predicate2 to use as the reject criteria
      Returns:
      Multimap, which contains elements that don't satisfy the predicate