Java Doc for CollectionChangeEventFactory.java in  » GIS » GeoTools-2.4.1 » org » apache » commons » events » observable » 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 » GIS » GeoTools 2.4.1 » org.apache.commons.events.observable 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.events.observable.CollectionChangeEventFactory

All known Subclasses:   org.apache.commons.events.observable.DefaultCollectionChangeEventFactory,
CollectionChangeEventFactory
public interface CollectionChangeEventFactory extends Cloneable(Code)

This interface defines a factory for the production of CollectionChangeEvents. The purpose of this factory is to provide a means of instantiating custom, user-defined CollectionChangeEvents without modification to the BoundCollection or ConstrainedCollection classes. Should users decide to write their own CollectionChangeEvents which provide more information than the supplied classes, they would need to implement this interface and supply an instance to the appropriate ObservedCollection class.


See Also:   CollectionChangeEvent
See Also:   CollectionChangeType
See Also:   BoundCollection
See Also:   ConstrainedCollection
author:
   Bryce Nordgren / USDA Forest Service
since:
   0.1




Method Summary
public  Objectclone()
    

Clones a CollectionChangeEventFactory by constructing a copy of the existing factory, without copying the event source.

public  CollectionChangeEventcreateAdd(Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type ADD.
public  CollectionChangeEventcreateAddAll(Collection element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type ADD_ALL.
public  CollectionChangeEventcreateAddAllIndexed(int index, Collection element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type ADD_ALL_INDEXED.
public  CollectionChangeEventcreateAddIndexed(int index, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type ADD_INDEXED.
public  CollectionChangeEventcreateAddIterated(int index, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type ADD_ITERATED.
public  CollectionChangeEventcreateAddNCopies(int copies, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type ADD_NCOPIES.
public  CollectionChangeEventcreateClear(boolean changed)
     Instantiates and returns a CollectionChangeEvent of type CLEAR.
public  CollectionChangeEventcreatePut(Object key, Object value, Object oldValue, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type PUT.
public  CollectionChangeEventcreatePutAll(Map newElements, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type PUT_ALL.
public  CollectionChangeEventcreateRemove(Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type REMOVE.
public  CollectionChangeEventcreateRemoveAll(Collection element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type REMOVE_ALL.
public  CollectionChangeEventcreateRemoveIndexed(int index, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type REMOVE_INDEXED.
public  CollectionChangeEventcreateRemoveIterated(int index, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type REMOVE_ITERATED.
public  CollectionChangeEventcreateRemoveNCopies(int copies, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type REMOVE_NCOPIES.
public  CollectionChangeEventcreateRemoveNext(Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type REMOVE_NEXT.
public  CollectionChangeEventcreateRetainAll(Collection element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type RETAIN_ALL.
public  CollectionChangeEventcreateSetIndexed(int index, Object oldValue, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type SET_INDEXED.
public  CollectionChangeEventcreateSetIterated(int index, Object oldValue, Object element, boolean changed)
     Instantiates and returns a CollectionChangeEvent of type SET_ITERATED.
public  ObjectgetCollection()
     Returns the collection responsible for events constructed by this factory.
public  voidsetCollection(Object source)
     Sets the collection responsible for events constructed by this factory.



Method Detail
clone
public Object clone()(Code)

Clones a CollectionChangeEventFactory by constructing a copy of the existing factory, without copying the event source. The user must call setCollection() on the returned factory prior to use. In effect, this event factory suffers from inadequate separation of concerns because it is required to know the details of event construction as well as the specific object which caused the event. This clone method causes duplication of the event construction logic while permitting the caller to specify a different event source. As such, implementors should ensure that all configuration and setup from the original object is duplicated in the returned object except for the event source.

This method exists so that sub lists (and other derivative collections) can use the same event factory as the original list.

A duplicate of this factory, except the event source is not set.



createAdd
public CollectionChangeEvent createAdd(Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type ADD.
Parameters:
  element - The element added to the collection.
Parameters:
  changed - True if the element was added to the collecton, false otherwise. A new event, properly initialized and ready to fire.



createAddAll
public CollectionChangeEvent createAddAll(Collection element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type ADD_ALL.
Parameters:
  element - The collection containing all the elements to be added.
Parameters:
  changed - True if the element was added to the collecton, false otherwise. A new event, properly initialized and ready to fire.



createAddAllIndexed
public CollectionChangeEvent createAddAllIndexed(int index, Collection element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type ADD_ALL_INDEXED. The "parameter" property is initialized to contain the index.
Parameters:
  element - The collection containing all the elements to be added.
Parameters:
  index - The index at which the collection is added.
Parameters:
  changed - True if the element was added to the collecton, false otherwise. A new event, properly initialized and ready to fire.



createAddIndexed
public CollectionChangeEvent createAddIndexed(int index, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type ADD_INDEXED. The "parameter" property is initialized to contain the index.
Parameters:
  element - The element added to the collection.
Parameters:
  index - The index at which the item is added.
Parameters:
  changed - True if the element was added to the collecton, false otherwise. A new event, properly initialized and ready to fire.



createAddIterated
public CollectionChangeEvent createAddIterated(int index, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type ADD_ITERATED. The "parameter" property is initialized to contain the index.
Parameters:
  element - The element added to the collection.
Parameters:
  index - The index at which the item is added.
Parameters:
  changed - True if the element was added to the collecton, false otherwise. A new event, properly initialized and ready to fire.



createAddNCopies
public CollectionChangeEvent createAddNCopies(int copies, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type ADD_NCOPIES. The "parameter" property is initialized to contain the specified number of copies.
Parameters:
  element - The element added to the collection.
Parameters:
  copies - How many copies to add.
Parameters:
  changed - True if the element was added to the collecton, false otherwise. A new event, properly initialized and ready to fire.



createClear
public CollectionChangeEvent createClear(boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type CLEAR.
Parameters:
  changed - True if the collection was nonempty before it was cleared, false otherwise. A new event, properly initialized and ready to fire.



createPut
public CollectionChangeEvent createPut(Object key, Object value, Object oldValue, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type PUT. This is unique among the CollectionChangeEvents in that a single addition involves two objects, namely a key-value pair. Additionally, the if the key was already present in the map, the former value is returned. The former and present "values" are stored in oldValue and newValue properties, respectively. The element property is set to the key.
Parameters:
  key - The key provided to the put() method.
Parameters:
  value - The value provided to the put() method.
Parameters:
  oldValue - The value returned by the call to put().
Parameters:
  changed - True if the element was changed,false otherwise. A new event, properly initialized and ready to fire.



createPutAll
public CollectionChangeEvent createPutAll(Map newElements, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type PUT_ALL. The element property is set to the Map containing all the entries to be added.
Parameters:
  newElements - The map containing the entries to add.
Parameters:
  changed - True if the element was changed,false otherwise. A new event, properly initialized and ready to fire.



createRemove
public CollectionChangeEvent createRemove(Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type REMOVE.
Parameters:
  element - The element removed from the collection.
Parameters:
  changed - True if the element was removed from the collecton, false otherwise. A new event, properly initialized and ready to fire.



createRemoveAll
public CollectionChangeEvent createRemoveAll(Collection element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type REMOVE_ALL.
Parameters:
  element - The collection containing all items to remove fromthis collection.
Parameters:
  changed - True if the element was removed from the collecton, false otherwise. A new event, properly initialized and ready to fire.



createRemoveIndexed
public CollectionChangeEvent createRemoveIndexed(int index, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type REMOVE_INDEXED. The "parameter" property is initialized to contain the index.
Parameters:
  element - The element removed from the collection.
Parameters:
  index - The index of the removed item.
Parameters:
  changed - True if the element was removed from the collecton, false otherwise. A new event, properly initialized and ready to fire.



createRemoveIterated
public CollectionChangeEvent createRemoveIterated(int index, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type REMOVE_ITERATED. The "parameter" property is initialized to contain the index.
Parameters:
  element - The element removed from the collection.
Parameters:
  index - The index of the iterator when remove was called.
Parameters:
  changed - True if the element was removed from the collecton, false otherwise. A new event, properly initialized and ready to fire.



createRemoveNCopies
public CollectionChangeEvent createRemoveNCopies(int copies, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type REMOVE_NCOPIES. The "parameter" property is initialized to contain the index.
Parameters:
  element - The element removed from the collection.
Parameters:
  copies - The number of copies to remove.
Parameters:
  changed - True if the element was removed from the collecton, false otherwise. A new event, properly initialized and ready to fire.



createRemoveNext
public CollectionChangeEvent createRemoveNext(Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type REMOVE_NEXT. The "parameter" property is initialized to contain the index. This event applies to a buffer.
Parameters:
  element - The element removed from the buffer.
Parameters:
  changed - True if the element was removed from the collecton, false otherwise. A new event, properly initialized and ready to fire.



createRetainAll
public CollectionChangeEvent createRetainAll(Collection element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type RETAIN_ALL.
Parameters:
  element - The Collection containing all elements to be retained.
Parameters:
  changed - True if the observed collection was changed. A new event, properly initialized and ready to fire.



createSetIndexed
public CollectionChangeEvent createSetIndexed(int index, Object oldValue, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type SET_INDEXED. The "parameter" property is initialized to contain the index. Additionally, the oldValue and newValue properties are set to the former and current values of the element at the index, respectively.
Parameters:
  element - The new value of the element at index. This is stored in the element and newValueproperties.
Parameters:
  oldValue - The former value of the element at index.This is stored in the oldValue property.
Parameters:
  index - The index of the changed item.
Parameters:
  changed - True if the element was changed,false otherwise. A new event, properly initialized and ready to fire.



createSetIterated
public CollectionChangeEvent createSetIterated(int index, Object oldValue, Object element, boolean changed)(Code)
Instantiates and returns a CollectionChangeEvent of type SET_ITERATED. The "parameter" property is initialized to contain the index. Additionally, the oldValue and newValue properties are set to the former and current values of the element at the index, respectively.
Parameters:
  element - The new value of the element at index. This is stored in the element and newValueproperties.
Parameters:
  oldValue - The former value of the element at index.This is stored in the oldValue property.
Parameters:
  index - The index of the changed item.
Parameters:
  changed - True if the element was changed,false otherwise. A new event, properly initialized and ready to fire.



getCollection
public Object getCollection()(Code)
Returns the collection responsible for events constructed by this factory. This must be one of the decorator classes defined in this package. source of CollectionChangeEvents.



setCollection
public void setCollection(Object source)(Code)
Sets the collection responsible for events constructed by this factory. This must be one of the decorator classes defined in this package. The type of this property is Object because java.util.Map, while part of the Collections framework, does not share a common parentage with java.util.Collection. Legal values are instances or subclasses of:
  • BoundCollection
  • ConstrainedCollection
  • BoundMap
This method is only allowed to be called once. Subsequent calls should result in an UnsupportedOperationException.
Parameters:
  source - The source of CollectionChangeEvents.
throws:
  IllegalArgumentException - if source is not a BoundCollection or a ConstrainedCollection.
throws:
  UnsupportedOperationException - if the source has already been set.



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