Java Doc for CollectionChangeEvent.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) 


java.lang.Object
   java.util.EventObject
      java.beans.PropertyChangeEvent
         org.apache.commons.events.observable.CollectionChangeEvent

CollectionChangeEvent
public class CollectionChangeEvent extends PropertyChangeEvent (Code)

This event is fired to all registered listeners whenever an observed collection is altered. The inherited oldValue and newValue properties are almost always null, as populating them normally requires that two nearly identical copies of the collection be maintained. The sole exception to this rule are events which replace a value in the collection with a different value (e.g., setting a particular element of a List.)

Instead, this event maintains information about how the collection was changed. This information includes:

  1. The type of action performed on the collection (e.g., add, remove, clear, etc.).
  2. The element participating in the action (e.g., the thing which was added, removed, etc.)
  3. Whether or not the collection was changed as a result of the action. For instance, attempting to remove an element which is not in a set does not change the set.
  4. An optional parameter which serves as an index or as an indicator of the number of copies affected, as appropriate for the event type.

This event is always fired after the proposed action has taken place. As such, it serves as a notification of an action, not pre-notification of the action. This same event is fired to subscribers of bound propertes and constrained properties. Those who wish to affect whether or not the change actually occurs should use a ConstrainedCollection. Those who merely wish to be notified of changes should use an BoundCollection.

The parent of this event is designed to monitor arbitrary properties of java beans. This class is designed to monitor only changes to collections. Therefore, the "property" field of this event is always set to "collection". Likewise, the "source" property must always be a BoundCollection or a ConstrainedCollection.


See Also:   java.beans.PropertyChangeEvent
See Also:   BoundCollection
See Also:   ConstrainedCollection
See Also:   CollectionChangeType
author:
   Bryce Nordgren / USDA Forest Service


Field Summary
final public static  intNOT_SET
     A value for the "parameter" property which means that the property has not been set.
final public static  StringPROPERTY
     The value to which every "property" field is set.

Constructor Summary
public  CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object element, int parameter)
     Public constructor for an event which monitors changes to collections.
public  CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object element)
    
public  CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed)
    
public  CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object element, Object oldElement, int parameter)
    

Public constructor which sets the oldValue and newValue properties of the parent object.

public  CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object key, Object oldValue, Object newValue)
    

Public constructor which initializes the event appropriately for reporting a put() event on a Map.


Method Summary
public  ObjectgetElement()
     A reference to the element participating in the action.
public  intgetParameter()
     The "parameter" is an indication of the index into the collection or the number of copies added or removed by the operation.
public  CollectionChangeTypegetType()
     Describes the action which caused this event.
public  booleanisChanged()
     Indicates whether the collection was changed as a result of the action.

Field Detail
NOT_SET
final public static int NOT_SET(Code)
A value for the "parameter" property which means that the property has not been set.



PROPERTY
final public static String PROPERTY(Code)
The value to which every "property" field is set.




Constructor Detail
CollectionChangeEvent
public CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object element, int parameter)(Code)
Public constructor for an event which monitors changes to collections. This constructor ensures that the old and new properties are set to null. It also ensures that the property name is set to "collection", as specified by the static PROPERTY field of this class.
Parameters:
  source - The collection which was modified.
Parameters:
  type - The type of modification.
Parameters:
  changed - Was the collection actually changed?
Parameters:
  element - The element participating in the modification.
Parameters:
  parameter - Used to indicate number of copies or index.



CollectionChangeEvent
public CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object element)(Code)



CollectionChangeEvent
public CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed)(Code)



CollectionChangeEvent
public CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object element, Object oldElement, int parameter)(Code)

Public constructor which sets the oldValue and newValue properties of the parent object. This should be used only when an individual element of a collection is changed from one value to another. This is applicable, for instance, when a map entry is changed or a list entry is set. The constructed object will have identical values for the "element" property and the "newValue" property.


Parameters:
  source - The collection which was modified.
Parameters:
  type - The type of modification.
Parameters:
  changed - Was the collection actually changed?
Parameters:
  element - The new value of the element.
Parameters:
  oldElement - the old value of the element.
Parameters:
  parameter - The index of the changed element.



CollectionChangeEvent
public CollectionChangeEvent(Object source, CollectionChangeType type, boolean changed, Object key, Object oldValue, Object newValue)(Code)

Public constructor which initializes the event appropriately for reporting a put() event on a Map. The oldValue and newValue properties are set to the former and current values mapped to the key. The element property is set to the key.


Parameters:
  source - The collection which was modified.
Parameters:
  type - The type of modification.
Parameters:
  changed - Was the collection actually changed?
Parameters:
  oldValue - The old value mapped to the key.
Parameters:
  newValue - The new value mapped to the key.
Parameters:
  key - The key which is being put in the Map.




Method Detail
getElement
public Object getElement()(Code)
A reference to the element participating in the action. This may be null if the change was an operation like clear(). the element added or removed from the collection.



getParameter
public int getParameter()(Code)
The "parameter" is an indication of the index into the collection or the number of copies added or removed by the operation. In many cases, the "parameter" will not be set, in which case it takes on the value NOT_SET. the index, number of copies, or NOT_SET



getType
public CollectionChangeType getType()(Code)
Describes the action which caused this event. type of action performed on the collection



isChanged
public boolean isChanged()(Code)
Indicates whether the collection was changed as a result of the action. true if the collection was changed, false otherwise.



Methods inherited from java.beans.PropertyChangeEvent
public Object getNewValue()(Code)(Java Doc)
public Object getOldValue()(Code)(Java Doc)
public Object getPropagationId()(Code)(Java Doc)
public String getPropertyName()(Code)(Java Doc)
public void setPropagationId(Object propagationId)(Code)(Java Doc)

Fields inherited from java.util.EventObject
protected transient Object source(Code)(Java Doc)

Methods inherited from java.util.EventObject
public Object getSource()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.