Java Doc for CompositeCollection.java in  » Library » Apache-common-Collections » org » apache » commons » collections » collection » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache common Collections » org.apache.commons.collections.collection 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.collections.collection.CompositeCollection

All known Subclasses:   org.apache.commons.collections.set.CompositeSet,
CompositeCollection
public class CompositeCollection implements Collection(Code)
Decorates a collection of other collections to provide a single unified view.

Changes made to this collection will actually be made on the decorated collection. Add and remove operations require the use of a pluggable strategy. If no strategy is provided then add and remove are unsupported.
since:
   Commons Collections 3.0
version:
   $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
author:
   Brian McCallister
author:
   Stephen Colebourne
author:
   Phil Steitz


Inner Class :public interface CollectionMutator

Field Summary
protected  Collection[]all
    
protected  CollectionMutatormutator
    

Constructor Summary
public  CompositeCollection()
     Create an empty CompositeCollection.
public  CompositeCollection(Collection coll)
     Create a Composite Collection with only coll composited.
public  CompositeCollection(Collection[] colls)
     Create a CompositeCollection with colls as the initial list of composited collections.

Method Summary
public  booleanadd(Object obj)
     Adds an object to the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
public  booleanaddAll(Collection coll)
     Adds a collection of elements to this collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
public  voidaddComposited(Collection[] comps)
    
public  voidaddComposited(Collection c)
     Add an additional collection to this composite.
public  voidaddComposited(Collection c, Collection d)
     Add two additional collections to this composite.
public  voidclear()
     Removes all of the elements from this collection .
public  booleancontains(Object obj)
     Checks whether this composite collection contains the object.
public  booleancontainsAll(Collection coll)
     Checks whether this composite contains all the elements in the specified collection.
public  CollectiongetCollections()
     Gets the collections being decorated.
public  booleanisEmpty()
     Checks whether this composite collection is empty.
public  Iteratoriterator()
     Gets an iterator over all the collections in this composite.

This implementation uses an IteratorChain. an IteratorChain instance which supportsremove().

public  booleanremove(Object obj)
     Removes an object from the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
public  booleanremoveAll(Collection coll)
     Removes the elements in the specified collection from this composite collection.
public  voidremoveComposited(Collection coll)
     Removes a collection from the those being decorated in this composite.
public  booleanretainAll(Collection coll)
     Retains all the elements in the specified collection in this composite collection, removing all others.
public  voidsetMutator(CollectionMutator mutator)
     Specify a CollectionMutator strategy instance to handle changes.
public  intsize()
     Gets the size of this composite collection.
public  Object[]toArray()
     Returns an array containing all of the elements in this composite.
public  Object[]toArray(Object[] array)
     Returns an object array, populating the supplied array if possible.
public  CollectiontoCollection()
    

Field Detail
all
protected Collection[] all(Code)
Collections in the composite



mutator
protected CollectionMutator mutator(Code)
CollectionMutator to handle changes to the collection




Constructor Detail
CompositeCollection
public CompositeCollection()(Code)
Create an empty CompositeCollection.



CompositeCollection
public CompositeCollection(Collection coll)(Code)
Create a Composite Collection with only coll composited.
Parameters:
  coll - a collection to decorate



CompositeCollection
public CompositeCollection(Collection[] colls)(Code)
Create a CompositeCollection with colls as the initial list of composited collections.
Parameters:
  colls - an array of collections to decorate




Method Detail
add
public boolean add(Object obj)(Code)
Adds an object to the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
Parameters:
  obj - the object to add true if the collection was modified
throws:
  UnsupportedOperationException - if CollectionMutator hasn't been set
throws:
  UnsupportedOperationException - if add is unsupported
throws:
  ClassCastException - if the object cannot be added due to its type
throws:
  NullPointerException - if the object cannot be added because its null
throws:
  IllegalArgumentException - if the object cannot be added



addAll
public boolean addAll(Collection coll)(Code)
Adds a collection of elements to this collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
Parameters:
  coll - the collection to add true if the collection was modified
throws:
  UnsupportedOperationException - if CollectionMutator hasn't been set
throws:
  UnsupportedOperationException - if add is unsupported
throws:
  ClassCastException - if the object cannot be added due to its type
throws:
  NullPointerException - if the object cannot be added because its null
throws:
  IllegalArgumentException - if the object cannot be added



addComposited
public void addComposited(Collection[] comps)(Code)
Add these Collections to the list of collections in this composite
Parameters:
  comps - Collections to be appended to the composite



addComposited
public void addComposited(Collection c)(Code)
Add an additional collection to this composite.
Parameters:
  c - the collection to add



addComposited
public void addComposited(Collection c, Collection d)(Code)
Add two additional collections to this composite.
Parameters:
  c - the first collection to add
Parameters:
  d - the second collection to add



clear
public void clear()(Code)
Removes all of the elements from this collection .

This implementation calls clear() on each collection.
throws:
  UnsupportedOperationException - if clear is unsupported




contains
public boolean contains(Object obj)(Code)
Checks whether this composite collection contains the object.

This implementation calls contains() on each collection.
Parameters:
  obj - the object to search for true if obj is contained in any of the contained collections




containsAll
public boolean containsAll(Collection coll)(Code)
Checks whether this composite contains all the elements in the specified collection.

This implementation calls contains() for each element in the specified collection.
Parameters:
  coll - the collection to check for true if all elements contained




getCollections
public Collection getCollections()(Code)
Gets the collections being decorated. Unmodifiable collection of all collections in this composite.



isEmpty
public boolean isEmpty()(Code)
Checks whether this composite collection is empty.

This implementation calls isEmpty() on each collection. true if all of the contained collections are empty




iterator
public Iterator iterator()(Code)
Gets an iterator over all the collections in this composite.

This implementation uses an IteratorChain. an IteratorChain instance which supportsremove(). Iteration occurs over contained collections inthe order they were added, but this behavior should not be relied upon.
See Also:   IteratorChain




remove
public boolean remove(Object obj)(Code)
Removes an object from the collection, throwing UnsupportedOperationException unless a CollectionMutator strategy is specified.
Parameters:
  obj - the object being removed true if the collection is changed
throws:
  UnsupportedOperationException - if removed is unsupported
throws:
  ClassCastException - if the object cannot be removed due to its type
throws:
  NullPointerException - if the object cannot be removed because its null
throws:
  IllegalArgumentException - if the object cannot be removed



removeAll
public boolean removeAll(Collection coll)(Code)
Removes the elements in the specified collection from this composite collection.

This implementation calls removeAll on each collection.
Parameters:
  coll - the collection to remove true if the collection was modified
throws:
  UnsupportedOperationException - if removeAll is unsupported




removeComposited
public void removeComposited(Collection coll)(Code)
Removes a collection from the those being decorated in this composite.
Parameters:
  coll - collection to be removed



retainAll
public boolean retainAll(Collection coll)(Code)
Retains all the elements in the specified collection in this composite collection, removing all others.

This implementation calls retainAll() on each collection.
Parameters:
  coll - the collection to remove true if the collection was modified
throws:
  UnsupportedOperationException - if retainAll is unsupported




setMutator
public void setMutator(CollectionMutator mutator)(Code)
Specify a CollectionMutator strategy instance to handle changes.
Parameters:
  mutator - the mutator to use



size
public int size()(Code)
Gets the size of this composite collection.

This implementation calls size() on each collection. total number of elements in all contained containers




toArray
public Object[] toArray()(Code)
Returns an array containing all of the elements in this composite. an object array of all the elements in the collection



toArray
public Object[] toArray(Object[] array)(Code)
Returns an object array, populating the supplied array if possible. See Collection interface for full details.
Parameters:
  array - the array to use, populating if possible an array of all the elements in the collection



toCollection
public Collection toCollection()(Code)
Returns a new collection containing all of the elements A new ArrayList containing all of the elements in this composite.The new collection is not backed by this composite.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.