Module qtjambi
Package io.qt.core

Class QHash<K,V>

All Implemented Interfaces:
QtObjectInterface, Cloneable, Iterable<QPair<K,V>>, Map<K,V>

public class QHash<K,V> extends QtJambiHashObject<K,V> implements Cloneable

Java wrapper for Qt class QHash

  • Constructor Details

  • Method Details

    • createVariantHash

      public static QHash<String,Object> createVariantHash()
    • clone

      public QHash<K,V> clone()
      Overrides:
      clone in class Object
    • begin

      @QtUninvokable protected final QMapIterator<K,V> begin()
      Specified by:
      begin in class QtJambiAbstractMapObject<K,V>
    • capacity

      @QtUninvokable public final int capacity()
    • clear

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

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

      @QtUninvokable public final int count()
    • count

      @QtUninvokable public final int count(K key)
    • end

      @QtUninvokable protected final QMapIterator<K,V> end()
      Specified by:
      end in class QtJambiAbstractMapObject<K,V>
    • find

      @QtUninvokable public final QMapIterator<K,V> find(K key)
    • insert

      @QtUninvokable public final void insert(K key, V value)
    • isEmpty

      @QtUninvokable public final boolean isEmpty()
      Specified by:
      isEmpty in interface Map<K,V>
      Specified by:
      isEmpty in class QtJambiAbstractMapObject<K,V>
    • key

      @QtUninvokable public final K key(V value)
    • key

      @QtUninvokable public final K key(V value, K defaultKey)
    • keys

      @QtUninvokable public final List<K> keys()
      Specified by:
      keys in class QtJambiAbstractMapObject<K,V>
    • keys

      @QtUninvokable public final List<K> keys(V value)
    • 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<K,V>
      Specified by:
      size in class QtJambiAbstractMapObject<K,V>
    • squeeze

      @QtUninvokable public final void squeeze()
    • take

      @QtUninvokable public final V take(K key)
    • value

      @QtUninvokable public final V value(K key)
    • value

      @QtUninvokable public final V value(K key, V defaultValue)
    • values

      @QtUninvokable public final List<V> values()
      Specified by:
      values in interface Map<K,V>
    • equals

      @QtUninvokable public boolean equals(Object other)
      Description copied from class: QtObject
      Used to check if this object shares native resources with the other object if the other object is a subtype of QtJambiInterface. Otherwise it will return the result of calling the super class implementation.
      Specified by:
      equals in interface Map<K,V>
      Overrides:
      equals in class QtObject
      Parameters:
      other - The object with which to compare
      Returns:
      true if the native resources of the two objects are one and the same.
    • hashCode

      @QtUninvokable public int hashCode()
      Specified by:
      hashCode in interface Map<K,V>
      Overrides:
      hashCode in class Object
    • toString

      @QtUninvokable public String toString()
      Overrides:
      toString in class QtJambiAbstractMapObject<K,V>
    • containsKey

      @QtUninvokable public final boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<K,V>
    • get

      @QtUninvokable public final V get(Object key)
      Specified by:
      get in interface Map<K,V>
    • put

      @QtUninvokable public final V put(K key, V value)
      Specified by:
      put in interface Map<K,V>
    • remove

      @QtUninvokable public final V remove(Object key)
      Specified by:
      remove in interface Map<K,V>
    • containsValue

      @QtUninvokable public final boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<K,V>
    • writeTo

      @QtUninvokable public void writeTo(QDataStream stream)
    • readFrom

      @QtUninvokable public void readFrom(QDataStream stream)
    • of

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

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2)
      Returns a QHash containing two mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3)
      Returns a QHash containing three mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Returns a QHash containing four mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      k4 - the fourth mapping's key
      v4 - the fourth mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Returns a QHash containing five mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      k4 - the fourth mapping's key
      v4 - the fourth mapping's value
      k5 - the fifth mapping's key
      v5 - the fifth mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Returns a QHash containing six mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      k4 - the fourth mapping's key
      v4 - the fourth mapping's value
      k5 - the fifth mapping's key
      v5 - the fifth mapping's value
      k6 - the sixth mapping's key
      v6 - the sixth mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Returns a QHash containing seven mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      k4 - the fourth mapping's key
      v4 - the fourth mapping's value
      k5 - the fifth mapping's key
      v5 - the fifth mapping's value
      k6 - the sixth mapping's key
      v6 - the sixth mapping's value
      k7 - the seventh mapping's key
      v7 - the seventh mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
      Returns a QHash containing eight mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      k4 - the fourth mapping's key
      v4 - the fourth mapping's value
      k5 - the fifth mapping's key
      v5 - the fifth mapping's value
      k6 - the sixth mapping's key
      v6 - the sixth mapping's value
      k7 - the seventh mapping's key
      v7 - the seventh mapping's value
      k8 - the eighth mapping's key
      v8 - the eighth mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
      Returns a QHash containing nine mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      k4 - the fourth mapping's key
      v4 - the fourth mapping's value
      k5 - the fifth mapping's key
      v5 - the fifth mapping's value
      k6 - the sixth mapping's key
      v6 - the sixth mapping's value
      k7 - the seventh mapping's key
      v7 - the seventh mapping's value
      k8 - the eighth mapping's key
      v8 - the eighth mapping's value
      k9 - the ninth mapping's key
      v9 - the ninth mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • of

      public static <K, V> QHash<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
      Returns a QHash containing ten mappings.
      Type Parameters:
      K - the QHash's key type
      V - the QHash's value type
      Parameters:
      k1 - the first mapping's key
      v1 - the first mapping's value
      k2 - the second mapping's key
      v2 - the second mapping's value
      k3 - the third mapping's key
      v3 - the third mapping's value
      k4 - the fourth mapping's key
      v4 - the fourth mapping's value
      k5 - the fifth mapping's key
      v5 - the fifth mapping's value
      k6 - the sixth mapping's key
      v6 - the sixth mapping's value
      k7 - the seventh mapping's key
      v7 - the seventh mapping's value
      k8 - the eighth mapping's key
      v8 - the eighth mapping's value
      k9 - the ninth mapping's key
      v9 - the ninth mapping's value
      k10 - the tenth mapping's key
      v10 - the tenth mapping's value
      Returns:
      a QHash containing the specified mappings
      Throws:
      NullPointerException - if any key or value is null
    • ofEntries

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