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:19 BST 2008 -->
6 <META http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
8 CompositeCollection (Commons Collections
3.2.1 API)
11 <META NAME=
"keywords" CONTENT=
"org.apache.commons.collections.collection.CompositeCollection 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=
"CompositeCollection (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/CompositeCollection.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/collection/AbstractSerializableCollectionDecorator.html" title=
"class in org.apache.commons.collections.collection"><B>PREV CLASS
</B></A>
57 <A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.CollectionMutator.html" title=
"interface in org.apache.commons.collections.collection"><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/collection/CompositeCollection.html" target=
"_top"><B>FRAMES
</B></A>
60 <A HREF=
"CompositeCollection.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:
<A HREF=
"#nested_class_summary">NESTED
</A> |
<A HREF=
"#field_summary">FIELD
</A> |
<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:
<A HREF=
"#field_detail">FIELD
</A> |
<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.collection
</FONT>
91 Class CompositeCollection
</H2>
94 <IMG SRC=
"../../../../../resources/inherit.gif" ALT=
"extended by "><B>org.apache.commons.collections.collection.CompositeCollection
</B>
97 <DT><B>All Implemented Interfaces:
</B> <DD>java.lang.Iterable, java.util.Collection
</DD>
100 <DT><B>Direct Known Subclasses:
</B> <DD><A HREF=
"../../../../../org/apache/commons/collections/set/CompositeSet.html" title=
"class in org.apache.commons.collections.set">CompositeSet
</A></DD>
104 <DT><PRE>public class
<B>CompositeCollection
</B><DT>extends java.lang.Object
<DT>implements java.util.Collection
</DL>
108 Decorates a collection of other collections to provide a single unified view.
110 Changes made to this collection will actually be made on the decorated collection.
111 Add and remove operations require the use of a pluggable strategy. If no
112 strategy is provided then add and remove are unsupported.
117 <DT><B>Since:
</B></DT>
118 <DD>Commons Collections
3.0</DD>
119 <DT><B>Version:
</B></DT>
120 <DD>$Revision:
646777 $ $Date:
2008-
04-
10 13:
33:
15 +
0100 (Thu,
10 Apr
2008) $
</DD>
121 <DT><B>Author:
</B></DT>
122 <DD>Brian McCallister, Stephen Colebourne, Phil Steitz
</DD>
127 <!-- ======== NESTED CLASS SUMMARY ======== -->
129 <A NAME=
"nested_class_summary"><!-- --></A>
130 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
131 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
132 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
133 <B>Nested Class Summary
</B></FONT></TH>
135 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
136 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
137 <CODE>static
interface
</CODE></FONT></TD>
138 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.CollectionMutator.html" title=
"interface in org.apache.commons.collections.collection">CompositeCollection.CollectionMutator
</A></B></CODE>
141 Pluggable strategy to handle changes to the composite.
</TD>
144 <!-- =========== FIELD SUMMARY =========== -->
146 <A NAME=
"field_summary"><!-- --></A>
147 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
148 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
149 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
150 <B>Field Summary
</B></FONT></TH>
152 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
153 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
154 <CODE>protected
java.util.Collection[]
</CODE></FONT></TD>
155 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#all">all
</A></B></CODE>
158 Collections in the composite
</TD>
160 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
161 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
162 <CODE>protected
<A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.CollectionMutator.html" title=
"interface in org.apache.commons.collections.collection">CompositeCollection.CollectionMutator
</A></CODE></FONT></TD>
163 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#mutator">mutator
</A></B></CODE>
166 CollectionMutator to handle changes to the collection
</TD>
170 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
172 <A NAME=
"constructor_summary"><!-- --></A>
173 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
174 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
175 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
176 <B>Constructor Summary
</B></FONT></TH>
178 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
179 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#CompositeCollection()">CompositeCollection
</A></B>()
</CODE>
182 Create an empty CompositeCollection.
</TD>
184 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
185 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#CompositeCollection(java.util.Collection)">CompositeCollection
</A></B>(java.util.Collection
coll)
</CODE>
188 Create a Composite Collection with only coll composited.
</TD>
190 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
191 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#CompositeCollection(java.util.Collection[])">CompositeCollection
</A></B>(java.util.Collection[]
colls)
</CODE>
194 Create a CompositeCollection with colls as the initial list of
195 composited collections.
</TD>
199 <!-- ========== METHOD SUMMARY =========== -->
201 <A NAME=
"method_summary"><!-- --></A>
202 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
203 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
204 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
205 <B>Method Summary
</B></FONT></TH>
207 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
208 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
209 <CODE> boolean
</CODE></FONT></TD>
210 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#add(java.lang.Object)">add
</A></B>(java.lang.Object
obj)
</CODE>
213 Adds an object to the collection, throwing UnsupportedOperationException
214 unless a CollectionMutator strategy is specified.
</TD>
216 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
217 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
218 <CODE> boolean
</CODE></FONT></TD>
219 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#addAll(java.util.Collection)">addAll
</A></B>(java.util.Collection
coll)
</CODE>
222 Adds a collection of elements to this collection, throwing
223 UnsupportedOperationException unless a CollectionMutator strategy is specified.
</TD>
225 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
226 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
227 <CODE> void
</CODE></FONT></TD>
228 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#addComposited(java.util.Collection)">addComposited
</A></B>(java.util.Collection
c)
</CODE>
231 Add an additional collection to this composite.
</TD>
233 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
234 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
235 <CODE> void
</CODE></FONT></TD>
236 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#addComposited(java.util.Collection[])">addComposited
</A></B>(java.util.Collection[]
comps)
</CODE>
239 Add these Collections to the list of collections in this composite
</TD>
241 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
242 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
243 <CODE> void
</CODE></FONT></TD>
244 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#addComposited(java.util.Collection, java.util.Collection)">addComposited
</A></B>(java.util.Collection
c,
245 java.util.Collection
d)
</CODE>
248 Add two additional collections to this composite.
</TD>
250 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
251 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
252 <CODE> void
</CODE></FONT></TD>
253 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#clear()">clear
</A></B>()
</CODE>
256 Removes all of the elements from this collection .
</TD>
258 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
259 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
260 <CODE> boolean
</CODE></FONT></TD>
261 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#contains(java.lang.Object)">contains
</A></B>(java.lang.Object
obj)
</CODE>
264 Checks whether this composite collection contains the object.
</TD>
266 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
267 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
268 <CODE> boolean
</CODE></FONT></TD>
269 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#containsAll(java.util.Collection)">containsAll
</A></B>(java.util.Collection
coll)
</CODE>
272 Checks whether this composite contains all the elements in the specified collection.
</TD>
274 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
275 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
276 <CODE> java.util.Collection
</CODE></FONT></TD>
277 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#getCollections()">getCollections
</A></B>()
</CODE>
280 Gets the collections being decorated.
</TD>
282 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
283 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
284 <CODE> boolean
</CODE></FONT></TD>
285 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#isEmpty()">isEmpty
</A></B>()
</CODE>
288 Checks whether this composite collection is empty.
</TD>
290 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
291 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
292 <CODE> java.util.Iterator
</CODE></FONT></TD>
293 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#iterator()">iterator
</A></B>()
</CODE>
296 Gets an iterator over all the collections in this composite.
</TD>
298 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
299 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
300 <CODE> boolean
</CODE></FONT></TD>
301 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#remove(java.lang.Object)">remove
</A></B>(java.lang.Object
obj)
</CODE>
304 Removes an object from the collection, throwing UnsupportedOperationException
305 unless a CollectionMutator strategy is specified.
</TD>
307 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
308 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
309 <CODE> boolean
</CODE></FONT></TD>
310 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#removeAll(java.util.Collection)">removeAll
</A></B>(java.util.Collection
coll)
</CODE>
313 Removes the elements in the specified collection from this composite collection.
</TD>
315 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
316 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
317 <CODE> void
</CODE></FONT></TD>
318 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#removeComposited(java.util.Collection)">removeComposited
</A></B>(java.util.Collection
coll)
</CODE>
321 Removes a collection from the those being decorated in this composite.
</TD>
323 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
324 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
325 <CODE> boolean
</CODE></FONT></TD>
326 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#retainAll(java.util.Collection)">retainAll
</A></B>(java.util.Collection
coll)
</CODE>
329 Retains all the elements in the specified collection in this composite collection,
330 removing all others.
</TD>
332 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
333 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
334 <CODE> void
</CODE></FONT></TD>
335 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#setMutator(org.apache.commons.collections.collection.CompositeCollection.CollectionMutator)">setMutator
</A></B>(
<A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.CollectionMutator.html" title=
"interface in org.apache.commons.collections.collection">CompositeCollection.CollectionMutator
</A> mutator)
</CODE>
338 Specify a CollectionMutator strategy instance to handle changes.
</TD>
340 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
341 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
342 <CODE> int
</CODE></FONT></TD>
343 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#size()">size
</A></B>()
</CODE>
346 Gets the size of this composite collection.
</TD>
348 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
349 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
350 <CODE> java.lang.Object[]
</CODE></FONT></TD>
351 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#toArray()">toArray
</A></B>()
</CODE>
354 Returns an array containing all of the elements in this composite.
</TD>
356 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
357 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
358 <CODE> java.lang.Object[]
</CODE></FONT></TD>
359 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#toArray(java.lang.Object[])">toArray
</A></B>(java.lang.Object[]
array)
</CODE>
362 Returns an object array, populating the supplied array if possible.
</TD>
364 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
365 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
366 <CODE> java.util.Collection
</CODE></FONT></TD>
367 <TD><CODE><B><A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.html#toCollection()">toCollection
</A></B>()
</CODE>
370 Returns a new collection containing all of the elements
</TD>
373 <A NAME=
"methods_inherited_from_class_java.lang.Object"><!-- --></A>
374 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
375 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
376 <TH ALIGN=
"left"><B>Methods inherited from class java.lang.Object
</B></TH>
378 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
379 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
382 <A NAME=
"methods_inherited_from_class_java.util.Collection"><!-- --></A>
383 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
384 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
385 <TH ALIGN=
"left"><B>Methods inherited from interface java.util.Collection
</B></TH>
387 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
388 <TD><CODE>equals, hashCode
</CODE></TD>
394 <!-- ============ FIELD DETAIL =========== -->
396 <A NAME=
"field_detail"><!-- --></A>
397 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
398 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
399 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
400 <B>Field Detail
</B></FONT></TH>
404 <A NAME=
"mutator"><!-- --></A><H3>
407 protected
<A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.CollectionMutator.html" title=
"interface in org.apache.commons.collections.collection">CompositeCollection.CollectionMutator
</A> <B>mutator
</B></PRE>
409 <DD>CollectionMutator to handle changes to the collection
416 <A NAME=
"all"><!-- --></A><H3>
419 protected java.util.Collection[]
<B>all
</B></PRE>
421 <DD>Collections in the composite
427 <!-- ========= CONSTRUCTOR DETAIL ======== -->
429 <A NAME=
"constructor_detail"><!-- --></A>
430 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
431 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
432 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
433 <B>Constructor Detail
</B></FONT></TH>
437 <A NAME=
"CompositeCollection()"><!-- --></A><H3>
438 CompositeCollection
</H3>
440 public
<B>CompositeCollection
</B>()
</PRE>
442 <DD>Create an empty CompositeCollection.
447 <A NAME=
"CompositeCollection(java.util.Collection)"><!-- --></A><H3>
448 CompositeCollection
</H3>
450 public
<B>CompositeCollection
</B>(java.util.Collection
coll)
</PRE>
452 <DD>Create a Composite Collection with only coll composited.
455 <DT><B>Parameters:
</B><DD><CODE>coll
</CODE> - a collection to decorate
</DL>
459 <A NAME=
"CompositeCollection(java.util.Collection[])"><!-- --></A><H3>
460 CompositeCollection
</H3>
462 public
<B>CompositeCollection
</B>(java.util.Collection[]
colls)
</PRE>
464 <DD>Create a CompositeCollection with colls as the initial list of
465 composited collections.
468 <DT><B>Parameters:
</B><DD><CODE>colls
</CODE> - an array of collections to decorate
</DL>
471 <!-- ============ METHOD DETAIL ========== -->
473 <A NAME=
"method_detail"><!-- --></A>
474 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
475 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
476 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
477 <B>Method Detail
</B></FONT></TH>
481 <A NAME=
"size()"><!-- --></A><H3>
484 public int
<B>size
</B>()
</PRE>
486 <DD>Gets the size of this composite collection.
488 This implementation calls
<code>size()
</code> on each collection.
491 <DT><B>Specified by:
</B><DD><CODE>size
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
495 <DT><B>Returns:
</B><DD>total number of elements in all contained containers
</DL>
500 <A NAME=
"isEmpty()"><!-- --></A><H3>
503 public boolean
<B>isEmpty
</B>()
</PRE>
505 <DD>Checks whether this composite collection is empty.
507 This implementation calls
<code>isEmpty()
</code> on each collection.
510 <DT><B>Specified by:
</B><DD><CODE>isEmpty
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
514 <DT><B>Returns:
</B><DD>true if all of the contained collections are empty
</DL>
519 <A NAME=
"contains(java.lang.Object)"><!-- --></A><H3>
522 public boolean
<B>contains
</B>(java.lang.Object
obj)
</PRE>
524 <DD>Checks whether this composite collection contains the object.
526 This implementation calls
<code>contains()
</code> on each collection.
529 <DT><B>Specified by:
</B><DD><CODE>contains
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
532 <DT><B>Parameters:
</B><DD><CODE>obj
</CODE> - the object to search for
533 <DT><B>Returns:
</B><DD>true if obj is contained in any of the contained collections
</DL>
538 <A NAME=
"iterator()"><!-- --></A><H3>
541 public java.util.Iterator
<B>iterator
</B>()
</PRE>
543 <DD>Gets an iterator over all the collections in this composite.
545 This implementation uses an
<code>IteratorChain
</code>.
548 <DT><B>Specified by:
</B><DD><CODE>iterator
</CODE> in interface
<CODE>java.lang.Iterable
</CODE><DT><B>Specified by:
</B><DD><CODE>iterator
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
552 <DT><B>Returns:
</B><DD>an
<code>IteratorChain
</code> instance which supports
553 <code>remove()
</code>. Iteration occurs over contained collections in
554 the order they were added, but this behavior should not be relied upon.
<DT><B>See Also:
</B><DD><A HREF=
"../../../../../org/apache/commons/collections/iterators/IteratorChain.html" title=
"class in org.apache.commons.collections.iterators"><CODE>IteratorChain
</CODE></A></DL>
559 <A NAME=
"toArray()"><!-- --></A><H3>
562 public java.lang.Object[]
<B>toArray
</B>()
</PRE>
564 <DD>Returns an array containing all of the elements in this composite.
567 <DT><B>Specified by:
</B><DD><CODE>toArray
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
571 <DT><B>Returns:
</B><DD>an object array of all the elements in the collection
</DL>
576 <A NAME=
"toArray(java.lang.Object[])"><!-- --></A><H3>
579 public java.lang.Object[]
<B>toArray
</B>(java.lang.Object[]
array)
</PRE>
581 <DD>Returns an object array, populating the supplied array if possible.
582 See
<code>Collection
</code> interface for full details.
585 <DT><B>Specified by:
</B><DD><CODE>toArray
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
588 <DT><B>Parameters:
</B><DD><CODE>array
</CODE> - the array to use, populating if possible
589 <DT><B>Returns:
</B><DD>an array of all the elements in the collection
</DL>
594 <A NAME=
"add(java.lang.Object)"><!-- --></A><H3>
597 public boolean
<B>add
</B>(java.lang.Object
obj)
</PRE>
599 <DD>Adds an object to the collection, throwing UnsupportedOperationException
600 unless a CollectionMutator strategy is specified.
603 <DT><B>Specified by:
</B><DD><CODE>add
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
606 <DT><B>Parameters:
</B><DD><CODE>obj
</CODE> - the object to add
607 <DT><B>Returns:
</B><DD>true if the collection was modified
609 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if CollectionMutator hasn't been set
610 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if add is unsupported
611 <DD><CODE>java.lang.ClassCastException
</CODE> - if the object cannot be added due to its type
612 <DD><CODE>java.lang.NullPointerException
</CODE> - if the object cannot be added because its null
613 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the object cannot be added
</DL>
618 <A NAME=
"remove(java.lang.Object)"><!-- --></A><H3>
621 public boolean
<B>remove
</B>(java.lang.Object
obj)
</PRE>
623 <DD>Removes an object from the collection, throwing UnsupportedOperationException
624 unless a CollectionMutator strategy is specified.
627 <DT><B>Specified by:
</B><DD><CODE>remove
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
630 <DT><B>Parameters:
</B><DD><CODE>obj
</CODE> - the object being removed
631 <DT><B>Returns:
</B><DD>true if the collection is changed
633 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if removed is unsupported
634 <DD><CODE>java.lang.ClassCastException
</CODE> - if the object cannot be removed due to its type
635 <DD><CODE>java.lang.NullPointerException
</CODE> - if the object cannot be removed because its null
636 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the object cannot be removed
</DL>
641 <A NAME=
"containsAll(java.util.Collection)"><!-- --></A><H3>
644 public boolean
<B>containsAll
</B>(java.util.Collection
coll)
</PRE>
646 <DD>Checks whether this composite contains all the elements in the specified collection.
648 This implementation calls
<code>contains()
</code> for each element in the
649 specified collection.
652 <DT><B>Specified by:
</B><DD><CODE>containsAll
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
655 <DT><B>Parameters:
</B><DD><CODE>coll
</CODE> - the collection to check for
656 <DT><B>Returns:
</B><DD>true if all elements contained
</DL>
661 <A NAME=
"addAll(java.util.Collection)"><!-- --></A><H3>
664 public boolean
<B>addAll
</B>(java.util.Collection
coll)
</PRE>
666 <DD>Adds a collection of elements to this collection, throwing
667 UnsupportedOperationException unless a CollectionMutator strategy is specified.
670 <DT><B>Specified by:
</B><DD><CODE>addAll
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
673 <DT><B>Parameters:
</B><DD><CODE>coll
</CODE> - the collection to add
674 <DT><B>Returns:
</B><DD>true if the collection was modified
676 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if CollectionMutator hasn't been set
677 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if add is unsupported
678 <DD><CODE>java.lang.ClassCastException
</CODE> - if the object cannot be added due to its type
679 <DD><CODE>java.lang.NullPointerException
</CODE> - if the object cannot be added because its null
680 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the object cannot be added
</DL>
685 <A NAME=
"removeAll(java.util.Collection)"><!-- --></A><H3>
688 public boolean
<B>removeAll
</B>(java.util.Collection
coll)
</PRE>
690 <DD>Removes the elements in the specified collection from this composite collection.
692 This implementation calls
<code>removeAll
</code> on each collection.
695 <DT><B>Specified by:
</B><DD><CODE>removeAll
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
698 <DT><B>Parameters:
</B><DD><CODE>coll
</CODE> - the collection to remove
699 <DT><B>Returns:
</B><DD>true if the collection was modified
701 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if removeAll is unsupported
</DL>
706 <A NAME=
"retainAll(java.util.Collection)"><!-- --></A><H3>
709 public boolean
<B>retainAll
</B>(java.util.Collection
coll)
</PRE>
711 <DD>Retains all the elements in the specified collection in this composite collection,
714 This implementation calls
<code>retainAll()
</code> on each collection.
717 <DT><B>Specified by:
</B><DD><CODE>retainAll
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
720 <DT><B>Parameters:
</B><DD><CODE>coll
</CODE> - the collection to remove
721 <DT><B>Returns:
</B><DD>true if the collection was modified
723 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if retainAll is unsupported
</DL>
728 <A NAME=
"clear()"><!-- --></A><H3>
731 public void
<B>clear
</B>()
</PRE>
733 <DD>Removes all of the elements from this collection .
735 This implementation calls
<code>clear()
</code> on each collection.
738 <DT><B>Specified by:
</B><DD><CODE>clear
</CODE> in interface
<CODE>java.util.Collection
</CODE></DL>
743 <DD><CODE>java.lang.UnsupportedOperationException
</CODE> - if clear is unsupported
</DL>
748 <A NAME=
"setMutator(org.apache.commons.collections.collection.CompositeCollection.CollectionMutator)"><!-- --></A><H3>
751 public void
<B>setMutator
</B>(
<A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.CollectionMutator.html" title=
"interface in org.apache.commons.collections.collection">CompositeCollection.CollectionMutator
</A> mutator)
</PRE>
753 <DD>Specify a CollectionMutator strategy instance to handle changes.
759 <DT><B>Parameters:
</B><DD><CODE>mutator
</CODE> - the mutator to use
</DL>
764 <A NAME=
"addComposited(java.util.Collection[])"><!-- --></A><H3>
767 public void
<B>addComposited
</B>(java.util.Collection[]
comps)
</PRE>
769 <DD>Add these Collections to the list of collections in this composite
775 <DT><B>Parameters:
</B><DD><CODE>comps
</CODE> - Collections to be appended to the composite
</DL>
780 <A NAME=
"addComposited(java.util.Collection)"><!-- --></A><H3>
783 public void
<B>addComposited
</B>(java.util.Collection
c)
</PRE>
785 <DD>Add an additional collection to this composite.
791 <DT><B>Parameters:
</B><DD><CODE>c
</CODE> - the collection to add
</DL>
796 <A NAME=
"addComposited(java.util.Collection, java.util.Collection)"><!-- --></A><H3>
799 public void
<B>addComposited
</B>(java.util.Collection
c,
800 java.util.Collection
d)
</PRE>
802 <DD>Add two additional collections to this composite.
808 <DT><B>Parameters:
</B><DD><CODE>c
</CODE> - the first collection to add
<DD><CODE>d
</CODE> - the second collection to add
</DL>
813 <A NAME=
"removeComposited(java.util.Collection)"><!-- --></A><H3>
814 removeComposited
</H3>
816 public void
<B>removeComposited
</B>(java.util.Collection
coll)
</PRE>
818 <DD>Removes a collection from the those being decorated in this composite.
824 <DT><B>Parameters:
</B><DD><CODE>coll
</CODE> - collection to be removed
</DL>
829 <A NAME=
"toCollection()"><!-- --></A><H3>
832 public java.util.Collection
<B>toCollection
</B>()
</PRE>
834 <DD>Returns a new collection containing all of the elements
841 <DT><B>Returns:
</B><DD>A new ArrayList containing all of the elements in this composite.
842 The new collection is
<i>not
</i> backed by this composite.
</DL>
847 <A NAME=
"getCollections()"><!-- --></A><H3>
850 public java.util.Collection
<B>getCollections
</B>()
</PRE>
852 <DD>Gets the collections being decorated.
859 <DT><B>Returns:
</B><DD>Unmodifiable collection of all collections in this composite.
</DL>
862 <!-- ========= END OF CLASS DATA ========= -->
866 <!-- ======= START OF BOTTOM NAVBAR ====== -->
867 <A NAME=
"navbar_bottom"><!-- --></A>
868 <A HREF=
"#skip-navbar_bottom" title=
"Skip navigation links"></A>
869 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
871 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
872 <A NAME=
"navbar_bottom_firstrow"><!-- --></A>
873 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
874 <TR ALIGN=
"center" VALIGN=
"top">
875 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
876 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
877 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
878 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/CompositeCollection.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
879 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
880 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
881 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
882 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
886 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
892 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
893 <A HREF=
"../../../../../org/apache/commons/collections/collection/AbstractSerializableCollectionDecorator.html" title=
"class in org.apache.commons.collections.collection"><B>PREV CLASS
</B></A>
894 <A HREF=
"../../../../../org/apache/commons/collections/collection/CompositeCollection.CollectionMutator.html" title=
"interface in org.apache.commons.collections.collection"><B>NEXT CLASS
</B></A></FONT></TD>
895 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
896 <A HREF=
"../../../../../index.html?org/apache/commons/collections/collection/CompositeCollection.html" target=
"_top"><B>FRAMES
</B></A>
897 <A HREF=
"CompositeCollection.html" target=
"_top"><B>NO FRAMES
</B></A>
898 <SCRIPT type=
"text/javascript">
901 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
906 <A HREF=
"../../../../../allclasses-noframe.html"><B>All Classes
</B></A>
913 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
914 SUMMARY:
<A HREF=
"#nested_class_summary">NESTED
</A> |
<A HREF=
"#field_summary">FIELD
</A> |
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
915 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
916 DETAIL:
<A HREF=
"#field_detail">FIELD
</A> |
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
919 <A NAME=
"skip-navbar_bottom"></A>
920 <!-- ======== END OF BOTTOM NAVBAR ======= -->
923 Copyright ©
2001-
2008 <a href=
"http://www.apache.org/">The Apache Software Foundation
</a>. All Rights Reserved.