1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (build 1.5.0_07) on Fri Apr 11 15:39:17 BST 2008 -->
6 <META http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
8 MultiHashMap (Commons Collections
3.2.1 API)
11 <META NAME=
"keywords" CONTENT=
"org.apache.commons.collections.MultiHashMap class">
13 <LINK REL =
"stylesheet" TYPE=
"text/css" HREF=
"../../../../stylesheet.css" TITLE=
"Style">
15 <SCRIPT type=
"text/javascript">
16 function windowTitle()
18 parent.document.
title=
"MultiHashMap (Commons Collections 3.2.1 API)";
26 <BODY BGCOLOR=
"white" onload=
"windowTitle();">
29 <!-- ========= START OF TOP NAVBAR ======= -->
30 <A NAME=
"navbar_top"><!-- --></A>
31 <A HREF=
"#skip-navbar_top" title=
"Skip navigation links"></A>
32 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
34 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
35 <A NAME=
"navbar_top_firstrow"><!-- --></A>
36 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
37 <TR ALIGN=
"center" VALIGN=
"top">
38 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
39 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
40 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
41 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/MultiHashMap.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
42 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
43 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
44 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
45 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
49 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
55 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
56 <A HREF=
"../../../../org/apache/commons/collections/MapUtils.html" title=
"class in org.apache.commons.collections"><B>PREV CLASS
</B></A>
57 <A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections"><B>NEXT CLASS
</B></A></FONT></TD>
58 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
59 <A HREF=
"../../../../index.html?org/apache/commons/collections/MultiHashMap.html" target=
"_top"><B>FRAMES
</B></A>
60 <A HREF=
"MultiHashMap.html" target=
"_top"><B>NO FRAMES
</B></A>
61 <SCRIPT type=
"text/javascript">
64 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
69 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
76 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
77 SUMMARY:
NESTED
|
FIELD
|
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
78 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
79 DETAIL:
FIELD
|
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
82 <A NAME=
"skip-navbar_top"></A>
83 <!-- ========= END OF TOP NAVBAR ========= -->
86 <!-- ======== START OF CLASS DATA ======== -->
89 org.apache.commons.collections
</FONT>
91 Class MultiHashMap
</H2>
94 <IMG SRC=
"../../../../resources/inherit.gif" ALT=
"extended by ">java.util.AbstractMap
95 <IMG SRC=
"../../../../resources/inherit.gif" ALT=
"extended by ">java.util.HashMap
96 <IMG SRC=
"../../../../resources/inherit.gif" ALT=
"extended by "><B>org.apache.commons.collections.MultiHashMap
</B>
99 <DT><B>All Implemented Interfaces:
</B> <DD>java.io.Serializable, java.lang.Cloneable, java.util.Map,
<A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections">MultiMap
</A></DD>
102 <B>Deprecated.
</B> <I>Class now available as MultiValueMap in map subpackage.
103 This version is due to be removed in collections v4.0.
</I>
106 <DT><PRE>public class
<B>MultiHashMap
</B><DT>extends java.util.HashMap
<DT>implements
<A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections">MultiMap
</A></DL>
110 <code>MultiHashMap
</code> is the default implementation of the
111 <A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections"><CODE>MultiMap
</CODE></A> interface.
113 A
<code>MultiMap
</code> is a Map with slightly different semantics.
114 Putting a value into the map will add the value to a Collection at that key.
115 Getting a value will return a Collection, holding all the values put to that key.
117 This implementation uses an
<code>ArrayList
</code> as the collection.
118 The internal storage list is made available without cloning via the
119 <code>get(Object)
</code> and
<code>entrySet()
</code> methods.
120 The implementation returns
<code>null
</code> when there are no values mapped to a key.
124 MultiMap mhm = new MultiHashMap();
128 List list = (List) mhm.get(key);
</pre>
130 <code>list
</code> will be a list containing
"A",
"B",
"C".
135 <DT><B>Since:
</B></DT>
136 <DD>Commons Collections
2.0</DD>
137 <DT><B>Version:
</B></DT>
138 <DD>$Revision:
646777 $ $Date:
2008-
04-
10 13:
33:
15 +
0100 (Thu,
10 Apr
2008) $
</DD>
139 <DT><B>Author:
</B></DT>
140 <DD>Christopher Berry, James Strachan, Steve Downey, Stephen Colebourne, Julien Buret, Serhiy Yevtushenko, Robert Ribnitz
</DD>
141 <DT><B>See Also:
</B><DD><A HREF=
"../../../../serialized-form.html#org.apache.commons.collections.MultiHashMap">Serialized Form
</A></DL>
145 <!-- ======== NESTED CLASS SUMMARY ======== -->
147 <A NAME=
"nested_class_summary"><!-- --></A>
148 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
149 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
150 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
151 <B>Nested Class Summary
</B></FONT></TH>
154 <A NAME=
"nested_classes_inherited_from_class_java.util.Map"><!-- --></A>
155 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
156 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
157 <TH ALIGN=
"left"><B>Nested classes/interfaces inherited from interface java.util.Map
</B></TH>
159 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
160 <TD><CODE>java.util.Map.Entry
</CODE></TD>
165 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
167 <A NAME=
"constructor_summary"><!-- --></A>
168 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
169 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
170 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
171 <B>Constructor Summary
</B></FONT></TH>
173 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
174 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#MultiHashMap()">MultiHashMap
</A></B>()
</CODE>
177 <B>Deprecated.
</B> Constructor.
</TD>
179 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
180 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#MultiHashMap(int)">MultiHashMap
</A></B>(int
initialCapacity)
</CODE>
183 <B>Deprecated.
</B> Constructor.
</TD>
185 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
186 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#MultiHashMap(int, float)">MultiHashMap
</A></B>(int
initialCapacity,
187 float
loadFactor)
</CODE>
190 <B>Deprecated.
</B> Constructor.
</TD>
192 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
193 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#MultiHashMap(java.util.Map)">MultiHashMap
</A></B>(java.util.Map
mapToCopy)
</CODE>
196 <B>Deprecated.
</B> Constructor that copies the input map creating an independent copy.
</TD>
200 <!-- ========== METHOD SUMMARY =========== -->
202 <A NAME=
"method_summary"><!-- --></A>
203 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
204 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
205 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
206 <B>Method Summary
</B></FONT></TH>
208 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
209 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
210 <CODE> void
</CODE></FONT></TD>
211 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#clear()">clear
</A></B>()
</CODE>
214 <B>Deprecated.
</B> Clear the map.
</TD>
216 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
217 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
218 <CODE> java.lang.Object
</CODE></FONT></TD>
219 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#clone()">clone
</A></B>()
</CODE>
222 <B>Deprecated.
</B> Clones the map creating an independent copy.
</TD>
224 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
225 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
226 <CODE> boolean
</CODE></FONT></TD>
227 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#containsValue(java.lang.Object)">containsValue
</A></B>(java.lang.Object
value)
</CODE>
230 <B>Deprecated.
</B> Checks whether the map contains the value specified.
</TD>
232 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
233 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
234 <CODE> boolean
</CODE></FONT></TD>
235 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#containsValue(java.lang.Object, java.lang.Object)">containsValue
</A></B>(java.lang.Object
key,
236 java.lang.Object
value)
</CODE>
239 <B>Deprecated.
</B> Checks whether the collection at the specified key contains the value.
</TD>
241 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
242 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
243 <CODE>protected
java.util.Collection
</CODE></FONT></TD>
244 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#createCollection(java.util.Collection)">createCollection
</A></B>(java.util.Collection
coll)
</CODE>
247 <B>Deprecated.
</B> Creates a new instance of the map value Collection container.
</TD>
249 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
250 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
251 <CODE> java.util.Collection
</CODE></FONT></TD>
252 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#getCollection(java.lang.Object)">getCollection
</A></B>(java.lang.Object
key)
</CODE>
255 <B>Deprecated.
</B> Gets the collection mapped to the specified key.
</TD>
257 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
258 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
259 <CODE> java.util.Iterator
</CODE></FONT></TD>
260 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#iterator(java.lang.Object)">iterator
</A></B>(java.lang.Object
key)
</CODE>
263 <B>Deprecated.
</B> Gets an iterator for the collection mapped to the specified key.
</TD>
265 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
266 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
267 <CODE> java.lang.Object
</CODE></FONT></TD>
268 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#put(java.lang.Object, java.lang.Object)">put
</A></B>(java.lang.Object
key,
269 java.lang.Object
value)
</CODE>
272 <B>Deprecated.
</B> Adds the value to the collection associated with the specified key.
</TD>
274 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
275 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
276 <CODE> void
</CODE></FONT></TD>
277 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#putAll(java.util.Map)">putAll
</A></B>(java.util.Map
map)
</CODE>
280 <B>Deprecated.
</B> Override superclass to ensure that MultiMap instances are
281 correctly handled.
</TD>
283 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
284 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
285 <CODE> boolean
</CODE></FONT></TD>
286 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#putAll(java.lang.Object, java.util.Collection)">putAll
</A></B>(java.lang.Object
key,
287 java.util.Collection
values)
</CODE>
290 <B>Deprecated.
</B> Adds a collection of values to the collection associated with the specified key.
</TD>
292 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
293 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
294 <CODE> java.lang.Object
</CODE></FONT></TD>
295 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#remove(java.lang.Object, java.lang.Object)">remove
</A></B>(java.lang.Object
key,
296 java.lang.Object
item)
</CODE>
299 <B>Deprecated.
</B> Removes a specific value from map.
</TD>
301 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
302 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
303 <CODE> int
</CODE></FONT></TD>
304 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#size(java.lang.Object)">size
</A></B>(java.lang.Object
key)
</CODE>
307 <B>Deprecated.
</B> Gets the size of the collection mapped to the specified key.
</TD>
309 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
310 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
311 <CODE> int
</CODE></FONT></TD>
312 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#totalSize()">totalSize
</A></B>()
</CODE>
315 <B>Deprecated.
</B> Gets the total size of the map by counting all the values.
</TD>
317 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
318 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
319 <CODE> java.util.Collection
</CODE></FONT></TD>
320 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/MultiHashMap.html#values()">values
</A></B>()
</CODE>
323 <B>Deprecated.
</B> Gets a collection containing all the values in the map.
</TD>
326 <A NAME=
"methods_inherited_from_class_java.util.HashMap"><!-- --></A>
327 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
328 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
329 <TH ALIGN=
"left"><B>Methods inherited from class java.util.HashMap
</B></TH>
331 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
332 <TD><CODE>containsKey, entrySet, get, isEmpty, keySet, remove, size
</CODE></TD>
335 <A NAME=
"methods_inherited_from_class_java.util.AbstractMap"><!-- --></A>
336 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
337 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
338 <TH ALIGN=
"left"><B>Methods inherited from class java.util.AbstractMap
</B></TH>
340 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
341 <TD><CODE>equals, hashCode, toString
</CODE></TD>
344 <A NAME=
"methods_inherited_from_class_java.lang.Object"><!-- --></A>
345 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
346 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
347 <TH ALIGN=
"left"><B>Methods inherited from class java.lang.Object
</B></TH>
349 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
350 <TD><CODE>finalize, getClass, notify, notifyAll, wait, wait, wait
</CODE></TD>
353 <A NAME=
"methods_inherited_from_class_org.apache.commons.collections.MultiMap"><!-- --></A>
354 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
355 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
356 <TH ALIGN=
"left"><B>Methods inherited from interface org.apache.commons.collections.
<A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections">MultiMap
</A></B></TH>
358 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
359 <TD><CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html#get(java.lang.Object)">get
</A>,
<A HREF=
"../../../../org/apache/commons/collections/MultiMap.html#remove(java.lang.Object)">remove
</A>,
<A HREF=
"../../../../org/apache/commons/collections/MultiMap.html#size()">size
</A></CODE></TD>
362 <A NAME=
"methods_inherited_from_class_java.util.Map"><!-- --></A>
363 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
364 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
365 <TH ALIGN=
"left"><B>Methods inherited from interface java.util.Map
</B></TH>
367 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
368 <TD><CODE>containsKey, entrySet, equals, hashCode, isEmpty, keySet
</CODE></TD>
374 <!-- ========= CONSTRUCTOR DETAIL ======== -->
376 <A NAME=
"constructor_detail"><!-- --></A>
377 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
378 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
379 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
380 <B>Constructor Detail
</B></FONT></TH>
384 <A NAME=
"MultiHashMap()"><!-- --></A><H3>
387 public
<B>MultiHashMap
</B>()
</PRE>
389 <DD><B>Deprecated.
</B> <DD>Constructor.
394 <A NAME=
"MultiHashMap(int)"><!-- --></A><H3>
397 public
<B>MultiHashMap
</B>(int
initialCapacity)
</PRE>
399 <DD><B>Deprecated.
</B> <DD>Constructor.
402 <DT><B>Parameters:
</B><DD><CODE>initialCapacity
</CODE> - the initial map capacity
</DL>
406 <A NAME=
"MultiHashMap(int, float)"><!-- --></A><H3>
409 public
<B>MultiHashMap
</B>(int
initialCapacity,
410 float
loadFactor)
</PRE>
412 <DD><B>Deprecated.
</B> <DD>Constructor.
415 <DT><B>Parameters:
</B><DD><CODE>initialCapacity
</CODE> - the initial map capacity
<DD><CODE>loadFactor
</CODE> - the amount
0.0-
1.0 at which to resize the map
</DL>
419 <A NAME=
"MultiHashMap(java.util.Map)"><!-- --></A><H3>
422 public
<B>MultiHashMap
</B>(java.util.Map
mapToCopy)
</PRE>
424 <DD><B>Deprecated.
</B> <DD>Constructor that copies the input map creating an independent copy.
426 This method performs different behaviour depending on whether the map
427 specified is a MultiMap or not. If a MultiMap is specified, each internal
428 collection is also cloned. If the specified map only implements Map, then
429 the values are not cloned.
431 NOTE: From Commons Collections
3.1 this method correctly copies a MultiMap
432 to form a truly independent new map.
433 NOTE: From Commons Collections
3.2 this method delegates to the newly
434 added putAll(Map) override method.
437 <DT><B>Parameters:
</B><DD><CODE>mapToCopy
</CODE> - a Map to copy
</DL>
440 <!-- ============ METHOD DETAIL ========== -->
442 <A NAME=
"method_detail"><!-- --></A>
443 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
444 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
445 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
446 <B>Method Detail
</B></FONT></TH>
450 <A NAME=
"totalSize()"><!-- --></A><H3>
453 public int
<B>totalSize
</B>()
</PRE>
455 <DD><B>Deprecated.
</B> <DD>Gets the total size of the map by counting all the values.
462 <DT><B>Returns:
</B><DD>the total size of the map counting all values
<DT><B>Since:
</B></DT>
463 <DD>Commons Collections
3.1</DD>
469 <A NAME=
"getCollection(java.lang.Object)"><!-- --></A><H3>
472 public java.util.Collection
<B>getCollection
</B>(java.lang.Object
key)
</PRE>
474 <DD><B>Deprecated.
</B> <DD>Gets the collection mapped to the specified key.
475 This method is a convenience method to typecast the result of
<code>get(key)
</code>.
481 <DT><B>Parameters:
</B><DD><CODE>key
</CODE> - the key to retrieve
482 <DT><B>Returns:
</B><DD>the collection mapped to the key, null if no mapping
<DT><B>Since:
</B></DT>
483 <DD>Commons Collections
3.1</DD>
489 <A NAME=
"size(java.lang.Object)"><!-- --></A><H3>
492 public int
<B>size
</B>(java.lang.Object
key)
</PRE>
494 <DD><B>Deprecated.
</B> <DD>Gets the size of the collection mapped to the specified key.
500 <DT><B>Parameters:
</B><DD><CODE>key
</CODE> - the key to get size for
501 <DT><B>Returns:
</B><DD>the size of the collection at the key, zero if key not in map
<DT><B>Since:
</B></DT>
502 <DD>Commons Collections
3.1</DD>
508 <A NAME=
"iterator(java.lang.Object)"><!-- --></A><H3>
511 public java.util.Iterator
<B>iterator
</B>(java.lang.Object
key)
</PRE>
513 <DD><B>Deprecated.
</B> <DD>Gets an iterator for the collection mapped to the specified key.
519 <DT><B>Parameters:
</B><DD><CODE>key
</CODE> - the key to get an iterator for
520 <DT><B>Returns:
</B><DD>the iterator of the collection at the key, empty iterator if key not in map
<DT><B>Since:
</B></DT>
521 <DD>Commons Collections
3.1</DD>
527 <A NAME=
"put(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
530 public java.lang.Object
<B>put
</B>(java.lang.Object
key,
531 java.lang.Object
value)
</PRE>
533 <DD><B>Deprecated.
</B> <DD>Adds the value to the collection associated with the specified key.
535 Unlike a normal
<code>Map
</code> the previous value is not replaced.
536 Instead the new value is added to the collection stored against the key.
539 <DT><B>Specified by:
</B><DD><CODE>put
</CODE> in interface
<CODE>java.util.Map
</CODE><DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html#put(java.lang.Object, java.lang.Object)">put
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections">MultiMap
</A></CODE><DT><B>Overrides:
</B><DD><CODE>put
</CODE> in class
<CODE>java.util.HashMap
</CODE></DL>
542 <DT><B>Parameters:
</B><DD><CODE>key
</CODE> - the key to store against
<DD><CODE>value
</CODE> - the value to add to the collection at the key
543 <DT><B>Returns:
</B><DD>the value added if the map changed and null if the map did not change
</DL>
548 <A NAME=
"putAll(java.util.Map)"><!-- --></A><H3>
551 public void
<B>putAll
</B>(java.util.Map
map)
</PRE>
553 <DD><B>Deprecated.
</B> <DD>Override superclass to ensure that MultiMap instances are
556 NOTE: Prior to version
3.2, putAll(map) did not work properly
557 when passed a MultiMap.
560 <DT><B>Specified by:
</B><DD><CODE>putAll
</CODE> in interface
<CODE>java.util.Map
</CODE><DT><B>Overrides:
</B><DD><CODE>putAll
</CODE> in class
<CODE>java.util.HashMap
</CODE></DL>
563 <DT><B>Parameters:
</B><DD><CODE>map
</CODE> - the map to copy (either a normal or multi map)
</DL>
568 <A NAME=
"putAll(java.lang.Object, java.util.Collection)"><!-- --></A><H3>
571 public boolean
<B>putAll
</B>(java.lang.Object
key,
572 java.util.Collection
values)
</PRE>
574 <DD><B>Deprecated.
</B> <DD>Adds a collection of values to the collection associated with the specified key.
580 <DT><B>Parameters:
</B><DD><CODE>key
</CODE> - the key to store against
<DD><CODE>values
</CODE> - the values to add to the collection at the key, null ignored
581 <DT><B>Returns:
</B><DD>true if this map changed
<DT><B>Since:
</B></DT>
582 <DD>Commons Collections
3.1</DD>
588 <A NAME=
"containsValue(java.lang.Object)"><!-- --></A><H3>
591 public boolean
<B>containsValue
</B>(java.lang.Object
value)
</PRE>
593 <DD><B>Deprecated.
</B> <DD>Checks whether the map contains the value specified.
595 This checks all collections against all keys for the value, and thus could be slow.
598 <DT><B>Specified by:
</B><DD><CODE>containsValue
</CODE> in interface
<CODE>java.util.Map
</CODE><DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html#containsValue(java.lang.Object)">containsValue
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections">MultiMap
</A></CODE><DT><B>Overrides:
</B><DD><CODE>containsValue
</CODE> in class
<CODE>java.util.HashMap
</CODE></DL>
601 <DT><B>Parameters:
</B><DD><CODE>value
</CODE> - the value to search for
602 <DT><B>Returns:
</B><DD>true if the map contains the value
</DL>
607 <A NAME=
"containsValue(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
610 public boolean
<B>containsValue
</B>(java.lang.Object
key,
611 java.lang.Object
value)
</PRE>
613 <DD><B>Deprecated.
</B> <DD>Checks whether the collection at the specified key contains the value.
619 <DT><B>Parameters:
</B><DD><CODE>value
</CODE> - the value to search for
620 <DT><B>Returns:
</B><DD>true if the map contains the value
<DT><B>Since:
</B></DT>
621 <DD>Commons Collections
3.1</DD>
627 <A NAME=
"remove(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
630 public java.lang.Object
<B>remove
</B>(java.lang.Object
key,
631 java.lang.Object
item)
</PRE>
633 <DD><B>Deprecated.
</B> <DD>Removes a specific value from map.
635 The item is removed from the collection mapped to the specified key.
636 Other values attached to that key are unaffected.
638 If the last value for a key is removed,
<code>null
</code> will be returned
639 from a subsequant
<code>get(key)
</code>.
642 <DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html#remove(java.lang.Object, java.lang.Object)">remove
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections">MultiMap
</A></CODE></DL>
645 <DT><B>Parameters:
</B><DD><CODE>key
</CODE> - the key to remove from
<DD><CODE>item
</CODE> - the value to remove
646 <DT><B>Returns:
</B><DD>the value removed (which was passed in), null if nothing removed
</DL>
651 <A NAME=
"clear()"><!-- --></A><H3>
654 public void
<B>clear
</B>()
</PRE>
656 <DD><B>Deprecated.
</B> <DD>Clear the map.
658 This clears each collection in the map, and so may be slow.
661 <DT><B>Specified by:
</B><DD><CODE>clear
</CODE> in interface
<CODE>java.util.Map
</CODE><DT><B>Overrides:
</B><DD><CODE>clear
</CODE> in class
<CODE>java.util.HashMap
</CODE></DL>
669 <A NAME=
"values()"><!-- --></A><H3>
672 public java.util.Collection
<B>values
</B>()
</PRE>
674 <DD><B>Deprecated.
</B> <DD>Gets a collection containing all the values in the map.
676 This returns a collection containing the combination of values from all keys.
679 <DT><B>Specified by:
</B><DD><CODE>values
</CODE> in interface
<CODE>java.util.Map
</CODE><DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html#values()">values
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections">MultiMap
</A></CODE><DT><B>Overrides:
</B><DD><CODE>values
</CODE> in class
<CODE>java.util.HashMap
</CODE></DL>
683 <DT><B>Returns:
</B><DD>a collection view of the values contained in this map
</DL>
688 <A NAME=
"clone()"><!-- --></A><H3>
691 public java.lang.Object
<B>clone
</B>()
</PRE>
693 <DD><B>Deprecated.
</B> <DD>Clones the map creating an independent copy.
695 The clone will shallow clone the collections as well as the map.
698 <DT><B>Overrides:
</B><DD><CODE>clone
</CODE> in class
<CODE>java.util.HashMap
</CODE></DL>
702 <DT><B>Returns:
</B><DD>the cloned map
</DL>
707 <A NAME=
"createCollection(java.util.Collection)"><!-- --></A><H3>
708 createCollection
</H3>
710 protected java.util.Collection
<B>createCollection
</B>(java.util.Collection
coll)
</PRE>
712 <DD><B>Deprecated.
</B> <DD>Creates a new instance of the map value Collection container.
714 This method can be overridden to use your own collection type.
720 <DT><B>Parameters:
</B><DD><CODE>coll
</CODE> - the collection to copy, may be null
721 <DT><B>Returns:
</B><DD>the new collection
</DL>
724 <!-- ========= END OF CLASS DATA ========= -->
728 <!-- ======= START OF BOTTOM NAVBAR ====== -->
729 <A NAME=
"navbar_bottom"><!-- --></A>
730 <A HREF=
"#skip-navbar_bottom" title=
"Skip navigation links"></A>
731 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
733 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
734 <A NAME=
"navbar_bottom_firstrow"><!-- --></A>
735 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
736 <TR ALIGN=
"center" VALIGN=
"top">
737 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
738 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
739 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
740 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/MultiHashMap.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
741 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
742 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
743 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
744 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
748 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
754 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
755 <A HREF=
"../../../../org/apache/commons/collections/MapUtils.html" title=
"class in org.apache.commons.collections"><B>PREV CLASS
</B></A>
756 <A HREF=
"../../../../org/apache/commons/collections/MultiMap.html" title=
"interface in org.apache.commons.collections"><B>NEXT CLASS
</B></A></FONT></TD>
757 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
758 <A HREF=
"../../../../index.html?org/apache/commons/collections/MultiHashMap.html" target=
"_top"><B>FRAMES
</B></A>
759 <A HREF=
"MultiHashMap.html" target=
"_top"><B>NO FRAMES
</B></A>
760 <SCRIPT type=
"text/javascript">
763 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
768 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
775 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
776 SUMMARY:
NESTED
|
FIELD
|
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
777 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
778 DETAIL:
FIELD
|
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
781 <A NAME=
"skip-navbar_bottom"></A>
782 <!-- ======== END OF BOTTOM NAVBAR ======= -->
785 Copyright ©
2001-
2008 <a href=
"http://www.apache.org/">The Apache Software Foundation
</a>. All Rights Reserved.