Interface RMultimapRx<K,V>

Type Parameters:
K - key type
V - value type
All Superinterfaces:
RExpirableRx, RObjectRx
All Known Subinterfaces:
RListMultimapCacheNativeRx<K,V>, RListMultimapCacheRx<K,V>, RListMultimapRx<K,V>, RSetMultimapCacheNativeRx<K,V>, RSetMultimapCacheRx<K,V>, RSetMultimapRx<K,V>

public interface RMultimapRx<K,V> extends RExpirableRx
Base RxJava2 interface for Multimap object
Author:
Nikita Koksharov
  • Method Details

    • size

      io.reactivex.rxjava3.core.Single<Integer> size()
      Returns the number of key-value pairs in this multimap.
      Returns:
      size of multimap
    • containsKey

      io.reactivex.rxjava3.core.Single<Boolean> containsKey(Object key)
      Returns true if this multimap contains at least one key-value pair with the key key.
      Parameters:
      key - - map key
      Returns:
      true if contains a key
    • containsValue

      io.reactivex.rxjava3.core.Single<Boolean> containsValue(Object value)
      Returns true if this multimap contains at least one key-value pair with the value value.
      Parameters:
      value - - map value
      Returns:
      true if contains a value
    • containsEntry

      io.reactivex.rxjava3.core.Single<Boolean> containsEntry(Object key, Object value)
      Returns true if this multimap contains at least one key-value pair with the key key and the value value.
      Parameters:
      key - - map key
      value - - map value
      Returns:
      true if contains an entry
    • put

      io.reactivex.rxjava3.core.Single<Boolean> put(K key, V value)
      Stores a key-value pair in this multimap.

      Some multimap implementations allow duplicate key-value pairs, in which case put always adds a new key-value pair and increases the multimap size by 1. Other implementations prohibit duplicates, and storing a key-value pair that's already in the multimap has no effect.

      Parameters:
      key - - map key
      value - - map value
      Returns:
      true if the method increased the size of the multimap, or false if the multimap already contained the key-value pair and doesn't allow duplicates
    • remove

      io.reactivex.rxjava3.core.Single<Boolean> remove(Object key, Object value)
      Removes a single key-value pair with the key key and the value value from this multimap, if such exists. If multiple key-value pairs in the multimap fit this description, which one is removed is unspecified.
      Parameters:
      key - - map key
      value - - map value
      Returns:
      true if the multimap changed
    • putAll

      io.reactivex.rxjava3.core.Single<Boolean> putAll(K key, Iterable<? extends V> values)
      Stores a key-value pair in this multimap for each of values, all using the same key, key. Equivalent to (but expected to be more efficient than):
         
      
         for (V value : values) {
           put(key, value);
         }

      In particular, this is a no-op if values is empty.

      Parameters:
      key - - map key
      values - - map values
      Returns:
      true if the multimap changed
    • keySize

      io.reactivex.rxjava3.core.Single<Integer> keySize()
      Returns the number of key-value pairs in this multimap.
      Returns:
      keys amount
    • fastReplaceValues

      io.reactivex.rxjava3.core.Single<Void> fastReplaceValues(K key, Iterable<? extends V> values)
      Stores a collection of values with the same key, replacing any existing values for that key. Is faster by not returning the values.
      Parameters:
      key - - map key
      values - - map values
    • fastRemove

      io.reactivex.rxjava3.core.Single<Long> fastRemove(K... keys)
      Removes keys from map by one operation Works faster than RMultimap.remove but not returning the value associated with key
      Parameters:
      keys - - map keys
      Returns:
      the number of keys that were removed from the hash, not including specified but non existing keys
    • fastRemoveValue

      io.reactivex.rxjava3.core.Single<Long> fastRemoveValue(V... values)
      Removes values from map by one operation
      Parameters:
      values - map values
      Returns:
      the number of values that were removed from the map
    • readAllKeySet

      io.reactivex.rxjava3.core.Single<Set<K>> readAllKeySet()
      Read all keys at once
      Returns:
      keys