Module qtjambi
Package io.qt.core

Class QMultiHash<Key,T>

java.lang.Object
io.qt.QtObject
io.qt.core.QMultiHash<Key,T>
All Implemented Interfaces:
QtObjectInterface, Cloneable, Iterable<QPair<Key,T>>, Map<Key,List<T>>

public class QMultiHash<Key,T> extends QtObject implements Map<Key,List<T>>, Cloneable

Java wrapper for Qt class QMultiHash

  • Constructor Details

  • Method Details

    • clone

      public QMultiHash<Key,T> clone()
      Creates and returns a copy of this object.
    • capacity

      @QtUninvokable public final int capacity()
    • clear

      @QtUninvokable public final void clear()
      Specified by:
      clear in interface Map<Key,T>
    • contains

      @QtUninvokable public final boolean contains(Key key)
    • count

      @QtUninvokable public final int count()
    • count

      @QtUninvokable public final int count(Key key)
    • begin

      @QtUninvokable protected final QAssociativeIterator<Key,T> begin()
      Provides a mutable C++ iterator to the containers begin.

      See QMultiHash::begin()

      Returns:
      begin
    • end

      @QtUninvokable protected final QAssociativeIterator<Key,T> end()
      Provides a mutable C++ iterator to the containers end.

      See QMultiHash::end()

      Returns:
      end
    • constBegin

      @QtUninvokable protected final QAssociativeConstIterator<Key,T> constBegin()
      Provides a constant C++ iterator to the containers begin.

      See QMultiHash::constBegin()const

      Returns:
      begin
    • constEnd

      @QtUninvokable protected final QAssociativeConstIterator<Key,T> constEnd()
      Provides a constant C++ iterator to the containers end.

      See QMultiHash::constEnd()const

      Returns:
      end
    • find

      @QtUninvokable public final QAssociativeConstIterator<Key,T> find(Key key)
      Returns:
      iterator
    • insert

      @QtUninvokable public final void insert(Key key, T value)
    • isEmpty

      @QtUninvokable public final boolean isEmpty()
      Specified by:
      isEmpty in interface Map<Key,T>
      Returns:
      true if this container contains no elements
    • key

      @QtUninvokable public final Key key(T value)
    • key

      @QtUninvokable public final Key key(T value, Key defaultKey)
    • keys

      @QtUninvokable public final QList<Key> keys()
      Returns a List of the keys contained in this associative container.

      See QMultiHash::keys()const

      Returns:
      list of keys
    • keys

      @QtUninvokable public final QList<Key> keys(T value)
    • removeIf

      @QtUninvokable public final int removeIf(Predicate<Key> predicate)
    • removeIf

      @QtUninvokable public final int removeIf(BiPredicate<Key,T> predicate)
    • removeAll

      @QtUninvokable public final int removeAll(Object key)
    • reserve

      @QtUninvokable public final void reserve(int size)
    • size

      @QtUninvokable public final int size()
      Specified by:
      size in interface Map<Key,T>
      Returns:
      the number of elements in this container
    • squeeze

      @QtUninvokable public final void squeeze()
    • take

      @QtUninvokable public final T take(Key key)
    • uniqueKeys

      @QtUninvokable public final QList<Key> uniqueKeys()
      Returns:
      list of keys
    • unite

      @QtUninvokable public final void unite(QHash<? super Key,? super T> other)
    • unite

      @QtUninvokable public final void unite(Map<? super Key,? extends Collection<? super T>> other)
    • value

      @QtUninvokable public final T value(Key key)
    • value

      @QtUninvokable public final T value(Key key, T defaultValue)
    • values

      @QtUninvokable public final List<List<T>> values()
      Returns a List of the values contained in this multihash.
      Specified by:
      values in interface Map<Key,T>
      See Also:
    • listOfValues

      @QtUninvokable public final QList<T> listOfValues()
    • values

      @QtUninvokable public final QList<T> values(Key key)
    • count

      @QtUninvokable public final int count(Key key, T value)
    • find

      @QtUninvokable public final QAssociativeConstIterator<Key,T> find(Key key, T value)
    • removeAll

      @QtUninvokable public final int removeAll(Key key, T value)
    • replaceOne

      @QtUninvokable public final void replaceOne(Key key, T value)
    • contains

      @QtUninvokable public final boolean contains(Key key, T value)
    • equals

      @QtUninvokable public boolean equals(Object other)
      Specified by:
      equals in interface Map<Key,T>
      Overrides:
      equals in class QtObject
      Parameters:
      other - other object
      Returns:
      true if the native counterpart of the two objects are one and the same.
    • hashCode

      @QtUninvokable public int hashCode()
      Returns the objects's hash code computed by qHash(QMultiHash<Key,T>).
      Specified by:
      hashCode in interface Map<Key,T>
      Overrides:
      hashCode in class Object
    • toString

      @QtUninvokable public String toString()
      Returns the string representation of the object given by QVariant(this).toString().
      Returns:
      String
    • containsKey

      @QtUninvokable public final boolean containsKey(Object key)
      Returns true if this map contains a mapping for the specified key.
      Specified by:
      containsKey in interface Map<Key,T>
      See Also:
    • get

      @QtUninvokable public final List<T> get(Object key)
      Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
      Specified by:
      get in interface Map<Key,T>
      See Also:
    • put

      @QtUninvokable public final List<T> put(Key key, List<T> values)
      Associates the specified value with the specified key in this map.
      Specified by:
      put in interface Map<Key,T>
      See Also:
    • remove

      @QtUninvokable public final List<T> remove(Object key)
      Removes the mapping for a key from this map if it is present.
      Specified by:
      remove in interface Map<Key,T>
      See Also:
    • containsValue

      @QtUninvokable public final boolean containsValue(Object value)
      Returns true if this map maps one or more keys to the specified value.
      Specified by:
      containsValue in interface Map<Key,T>
      See Also:
    • writeTo

      @QtUninvokable public void writeTo(QDataStream stream)
    • readFrom

      @QtUninvokable public void readFrom(QDataStream stream)
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1)
      Returns a QMultiHash containing a single mapping.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the mapping's key
      t1 - the mapping's value
      Returns:
      a QMultiHash containing the specified mapping
      Throws:
      NullPointerException - if the key or the value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2)
      Returns a QMultiHash containing two mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3)
      Returns a QMultiHash containing three mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3, Key k4, T t4)
      Returns a QMultiHash containing four mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      k4 - the fourth mapping's key
      t4 - the fourth mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3, Key k4, T t4, Key k5, T t5)
      Returns a QMultiHash containing five mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      k4 - the fourth mapping's key
      t4 - the fourth mapping's value
      k5 - the fifth mapping's key
      t5 - the fifth mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3, Key k4, T t4, Key k5, T t5, Key k6, T t6)
      Returns a QMultiHash containing six mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      k4 - the fourth mapping's key
      t4 - the fourth mapping's value
      k5 - the fifth mapping's key
      t5 - the fifth mapping's value
      k6 - the sixth mapping's key
      t6 - the sixth mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3, Key k4, T t4, Key k5, T t5, Key k6, T t6, Key k7, T t7)
      Returns a QMultiHash containing seven mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      k4 - the fourth mapping's key
      t4 - the fourth mapping's value
      k5 - the fifth mapping's key
      t5 - the fifth mapping's value
      k6 - the sixth mapping's key
      t6 - the sixth mapping's value
      k7 - the seventh mapping's key
      t7 - the seventh mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3, Key k4, T t4, Key k5, T t5, Key k6, T t6, Key k7, T t7, Key k8, T t8)
      Returns a QMultiHash containing eight mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      k4 - the fourth mapping's key
      t4 - the fourth mapping's value
      k5 - the fifth mapping's key
      t5 - the fifth mapping's value
      k6 - the sixth mapping's key
      t6 - the sixth mapping's value
      k7 - the seventh mapping's key
      t7 - the seventh mapping's value
      k8 - the eighth mapping's key
      t8 - the eighth mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3, Key k4, T t4, Key k5, T t5, Key k6, T t6, Key k7, T t7, Key k8, T t8, Key k9, T t9)
      Returns a QMultiHash containing nine mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      k4 - the fourth mapping's key
      t4 - the fourth mapping's value
      k5 - the fifth mapping's key
      t5 - the fifth mapping's value
      k6 - the sixth mapping's key
      t6 - the sixth mapping's value
      k7 - the seventh mapping's key
      t7 - the seventh mapping's value
      k8 - the eighth mapping's key
      t8 - the eighth mapping's value
      k9 - the ninth mapping's key
      t9 - the ninth mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <Key, T> QMultiHash<Key,T> of(Key k1, T t1, Key k2, T t2, Key k3, T t3, Key k4, T t4, Key k5, T t5, Key k6, T t6, Key k7, T t7, Key k8, T t8, Key k9, T t9, Key k10, T t10)
      Returns a QMultiHash containing ten mappings.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      k1 - the first mapping's key
      t1 - the first mapping's value
      k2 - the second mapping's key
      t2 - the second mapping's value
      k3 - the third mapping's key
      t3 - the third mapping's value
      k4 - the fourth mapping's key
      t4 - the fourth mapping's value
      k5 - the fifth mapping's key
      t5 - the fifth mapping's value
      k6 - the sixth mapping's key
      t6 - the sixth mapping's value
      k7 - the seventh mapping's key
      t7 - the seventh mapping's value
      k8 - the eighth mapping's key
      t8 - the eighth mapping's value
      k9 - the ninth mapping's key
      t9 - the ninth mapping's value
      k10 - the tenth mapping's key
      t10 - the tenth mapping's value
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • ofEntries

      @SafeVarargs public static <Key, T> QMultiHash<Key,T> ofEntries(Map.Entry<? extends Key,? extends T> entry0, Map.Entry<? extends Key,? extends T>... entries)
      Returns a QMultiHash containing keys and values extracted from the given entries.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      entries - java.util.Map.Entrys containing the keys and values from which the map is populated
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any entry, key, or value is null, or if the entries array is null
    • ofPairs

      @SafeVarargs public static <Key, T> QMultiHash<Key,T> ofPairs(QPair<? extends Key,? extends T> pair0, QPair<? extends Key,? extends T>... pairs)
      Returns a QMultiHash containing keys and values extracted from the given pairs.
      Type Parameters:
      Key - the QMultiHash's key type
      T - the QMultiHash's value type
      Parameters:
      pairs - QPairs containing the keys and values from which the map is populated
      Returns:
      a QMultiHash containing the specified mappings
      Throws:
      NullPointerException - if any entry, key, or value is null, or if the entries array is null
    • keySet

      @QtUninvokable public final Set<Key> keySet()
      Returns a Set view of the keys contained in this map.
      Specified by:
      keySet in interface Map<Key,T>
    • entrySet

      @QtUninvokable public final Set<Map.Entry<Key,List<T>>> entrySet()
      Returns a Set view of the mappings contained in this map.
      Specified by:
      entrySet in interface Map<Key,T>
    • putAll

      @QtUninvokable public final void putAll(Map<? extends Key,? extends List<T>> m)
      Copies all of the mappings from the specified map to this map.
      Specified by:
      putAll in interface Map<Key,T>
    • iterator

      @QtUninvokable public final Iterator<QPair<Key,T>> iterator()
      Returns an iterator over elements of type QPair<K,V>.
      Specified by:
      iterator in interface Iterable<Key>
      Returns:
      an Iterator