Skip to content

Commit 59eb31d

Browse files
Update README.md
1 parent cf4633e commit 59eb31d

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed

README.md

+137
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,144 @@ Iterator<Map<Key, Value>> iterator = map.iterator(); → Cannot be Obtained
140140
</table>
141141
</ul>
142142

143+
<h2> </h2>
144+
<h2 align="Center"> Methods of Map Interface </h2>
145+
<ul>
146+
<table>
147+
<tr>
148+
<th>Methods of Map Interface </th>
149+
<th> Does This</th>
150+
</tr>
151+
152+
<tr>
153+
<td>1. clear() </td>
154+
<td> Removes all of the mappings from this map</td>
155+
</tr>
156+
157+
<tr>
158+
<td>2. compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction) </td>
159+
<td> Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping).</td>
160+
</tr>
161+
162+
<tr>
163+
<td>3. computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction) </td>
164+
<td> If the specified key is not already associated with a value (or is mapped to null), attempts to compute its value using the given mapping function and enters it into this map unless null.</td>
165+
</tr>
166+
167+
<tr>
168+
<td>4. computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction) </td>
169+
<td> If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value.</td>
170+
</tr>
171+
172+
<tr>
173+
<td>5. containsKey(Object key) </td>
174+
<td> Returns true if this map contains a mapping for the specified key.</td>
175+
</tr>
176+
177+
<tr>
178+
<td>6. containsValue(Object value) </td>
179+
<td>Returns true if this map maps one or more keys to the specified value.</td>
180+
</tr>
181+
182+
<tr>
183+
<td>7. entrySet() </td>
184+
<td>Returns a Set view of the mappings(All Entries) contained in this map.</td>
185+
</tr>
186+
187+
<tr>
188+
<td>8. equals(Object o) </td>
189+
<td>Compares the specified object with this map for equality.</td>
190+
</tr>
191+
192+
<tr>
193+
<td>9. forEach(BiConsumer<? super K,? super V> action) </td>
194+
<td>Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.</td>
195+
</tr>
196+
197+
<tr>
198+
<td>10. get(Object key) </td>
199+
<td>Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.</td>
200+
</tr>
201+
202+
<tr>
203+
<td>11. getOrDefault(Object key, V defaultValue) </td>
204+
<td>Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.</td>
205+
</tr>
206+
207+
<tr>
208+
<td>12. hashCode() </td>
209+
<td>Returns the hash code value for this map.</td>
210+
</tr>
211+
212+
<tr>
213+
<td>13. isEmpty() </td>
214+
<td>Returns true if this map contains no key-value mappings.</td>
215+
</tr>
216+
217+
<tr>
218+
<td>14.keySet() </td>
219+
<td>Returns a Set view of the keys contained in this map.</td>
220+
</tr>
221+
222+
<tr>
223+
<td>15.merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction) </td>
224+
<td>If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value.</td>
225+
</tr>
226+
227+
<tr>
228+
<td>16.put(K key, V value) </td>
229+
<td>Associates the specified value with the specified key in this map.</td>
230+
</tr>
231+
232+
<tr>
233+
<td>17.putAll(Map<? extends K,? extends V> m) </td>
234+
<td>Copies all of the mappings from the specified map to this map.</td>
235+
</tr>
236+
237+
<tr>
238+
<td>18.putIfAbsent(K key, V value) </td>
239+
<td>If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.</td>
240+
</tr>
241+
242+
<tr>
243+
<td>19.remove(Object key)</td>
244+
<td>Removes the mapping for a key from this map if it is present.</td>
245+
</tr>
246+
247+
<tr>
248+
<td>20.remove(Object key, Object value)</td>
249+
<td>Removes the entry for the specified key only if it is currently mapped to the specified value.</td>
250+
</tr>
251+
252+
<tr>
253+
<td>21.replace(K key, V value)</td>
254+
<td>Replaces the entry for the specified key only if it is currently mapped to some value.</td>
255+
</tr>
256+
257+
<tr>
258+
<td>22.replace(K key, V oldValue, V newValue)</td>
259+
<td>Replaces the entry for the specified key only if currently mapped to the specified value.</td>
260+
</tr>
261+
262+
<tr>
263+
<td>23.replaceAll(BiFunction<? super K,? super V,? extends V> function)</td>
264+
<td>Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.</td>
265+
</tr>
143266

267+
<tr>
268+
<td>24.size()</td>
269+
<td>Returns the number of key-value mappings in this map.</td>
270+
</tr>
271+
272+
<tr>
273+
<td>25.values()</td>
274+
<td>Returns a Collection view of the values contained in this map.</td>
275+
</tr>
276+
277+
</table>
278+
</ul>
279+
280+
<h1> </h1>
144281
<h1> 3. HashMap </h1>
145282

146283
<ul>

0 commit comments

Comments
 (0)