@Test public void testClear() { map.put(key1, value1); map.put(key2, value1); map.clear(); assertEquals(0, map.size()); assertEquals(0, map.assigned); testPutWithExpansions(); }
@Override public void clear() { assigned = 0; hasEmptyKey = false; Arrays.fill(keys, Intrinsics.<KType> empty()); Arrays.fill(values, Intrinsics.<VType> empty()); }
KTypeVTypeHashMap implements /*! #if ($templateonly) !*/ Intrinsics.EqualityFunction, /*! #end !*/
             /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
             KTypeVTypeMap<KType, VType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public void clear() { assigned = 0; hasEmptyKey = false; Arrays.fill(keys, Intrinsics.<KType> empty()); Arrays.fill(values, Intrinsics.<VType> empty()); } }
KTypeVTypeHashMap implements /*! #if ($templateonly) !*/ Intrinsics.EqualityFunction, /*! #end !*/
             /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
             KTypeVTypeMap<KType, VType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public void clear() { assigned = 0; hasEmptyKey = false; Arrays.fill(keys, Intrinsics.<KType> empty()); Arrays.fill(values, Intrinsics.<VType> empty()); } KTypeVTypeHashMap();  KTypeVTypeHashMap(int expectedElements);  KTypeVTypeHashMap(int expectedElements, double loadFactor);  KTypeVTypeHashMap(KTypeVTypeAssociativeContainer<? extends KType, ? extends VType> container); }
KTypeVTypeHashMap implements /*! #if ($templateonly) !*/ Intrinsics.EqualityFunction, /*! #end !*/
             /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
             KTypeVTypeMap<KType, VType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public void clear() { assigned = 0; hasEmptyKey = false; Arrays.fill(keys, Intrinsics.<KType> empty()); Arrays.fill(values, Intrinsics.<VType> empty()); } KTypeVTypeHashMap();  KTypeVTypeHashMap(int expectedElements);  KTypeVTypeHashMap(int expectedElements, double loadFactor);  KTypeVTypeHashMap(KTypeVTypeAssociativeContainer<? extends KType, ? extends VType> container); @Override VType put(KType key, VType value); @Override int putAll(KTypeVTypeAssociativeContainer<? extends KType, ? extends VType> container); @Override int putAll(Iterable<? extends KTypeVTypeCursor<? extends KType, ? extends VType>> iterable); boolean putIfAbsent(KType key, VType value); @Override VType putOrAdd(KType key, VType putValue, VType incrementValue); @Override VType addTo(KType key, VType incrementValue); @Override VType remove(KType key); @Override int removeAll(KTypeContainer<? super KType> other); @Override int removeAll(KTypeVTypePredicate<? super KType, ? super VType> predicate); @Override int removeAll(KTypePredicate<? super KType> predicate); @Override VType get(KType key); @Override VType getOrDefault(KType key, VType defaultValue); @Override boolean containsKey(KType key); @Override int indexOf(KType key); @Override boolean indexExists(int index); @Override VType indexGet(int index); @Override VType indexReplace(int index, VType newValue); @Override void indexInsert(int index, KType key, VType value); @Override void clear(); @Override void release(); @Override int size(); boolean isEmpty(); @Override int hashCode(); @Override boolean equals(Object obj); @Override void ensureCapacity(int expectedElements); @Override long ramBytesAllocated(); @Override long ramBytesUsed(); @Override Iterator<KTypeVTypeCursor<KType, VType>> iterator(); @Override T forEach(T procedure); @Override T forEach(T predicate); KeysContainer keys(); @Override KTypeCollection<VType> values(); @Override KTypeVTypeHashMap<KType, VType> clone(); @Override String toString(); @Override String visualizeKeyDistribution(int characters); static KTypeVTypeHashMap<KType, VType> from(KType[] keys, VType[] values); @Override int hashKey(KType key); @Override boolean equals(Object v1, Object v2); }
KTypeVTypeHashMap implements /*! #if ($templateonly) !*/ Intrinsics.EqualityFunction, /*! #end !*/
             /*! #if ($templateonly) !*/ Intrinsics.KeyHasher<KType>, /*! #end !*/
             KTypeVTypeMap<KType, VType>,
             Preallocable,
             Cloneable,
             Accountable { @Override public void clear() { assigned = 0; hasEmptyKey = false; Arrays.fill(keys, Intrinsics.<KType> empty()); Arrays.fill(values, Intrinsics.<VType> empty()); } KTypeVTypeHashMap();  KTypeVTypeHashMap(int expectedElements);  KTypeVTypeHashMap(int expectedElements, double loadFactor);  KTypeVTypeHashMap(KTypeVTypeAssociativeContainer<? extends KType, ? extends VType> container); @Override VType put(KType key, VType value); @Override int putAll(KTypeVTypeAssociativeContainer<? extends KType, ? extends VType> container); @Override int putAll(Iterable<? extends KTypeVTypeCursor<? extends KType, ? extends VType>> iterable); boolean putIfAbsent(KType key, VType value); @Override VType putOrAdd(KType key, VType putValue, VType incrementValue); @Override VType addTo(KType key, VType incrementValue); @Override VType remove(KType key); @Override int removeAll(KTypeContainer<? super KType> other); @Override int removeAll(KTypeVTypePredicate<? super KType, ? super VType> predicate); @Override int removeAll(KTypePredicate<? super KType> predicate); @Override VType get(KType key); @Override VType getOrDefault(KType key, VType defaultValue); @Override boolean containsKey(KType key); @Override int indexOf(KType key); @Override boolean indexExists(int index); @Override VType indexGet(int index); @Override VType indexReplace(int index, VType newValue); @Override void indexInsert(int index, KType key, VType value); @Override void clear(); @Override void release(); @Override int size(); boolean isEmpty(); @Override int hashCode(); @Override boolean equals(Object obj); @Override void ensureCapacity(int expectedElements); @Override long ramBytesAllocated(); @Override long ramBytesUsed(); @Override Iterator<KTypeVTypeCursor<KType, VType>> iterator(); @Override T forEach(T procedure); @Override T forEach(T predicate); KeysContainer keys(); @Override KTypeCollection<VType> values(); @Override KTypeVTypeHashMap<KType, VType> clone(); @Override String toString(); @Override String visualizeKeyDistribution(int characters); static KTypeVTypeHashMap<KType, VType> from(KType[] keys, VType[] values); @Override int hashKey(KType key); @Override boolean equals(Object v1, Object v2); public Object [] keys; public Object [] values; }