Package org.biojava.utils
Class ChangeEvent
java.lang.Object
java.util.EventObject
org.biojava.utils.ChangeEvent
- All Implemented Interfaces:
Serializable
Event which encapsulates a change in any mutable BioJava object.
- Since:
- 1.1
- Author:
- Thomas Down, Matthew Pocock, Greg Cox
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionChangeEvent
(Object source, ChangeType type) Construct a ChangeEvent with no change details.ChangeEvent
(Object source, ChangeType type, Object change) Construct a ChangeEvent specifying a new value for a property, or an object to be added to a collection.ChangeEvent
(Object source, ChangeType type, Object change, Object previous) Construct a ChangeEvent specifying a new value for a property, and giving the previous value.ChangeEvent
(Object source, ChangeType type, Object change, Object previous, ChangeEvent chain) Construct a ChangeEvent to be fired because another ChangeEvent has been received from a property object. -
Method Summary
Modifier and TypeMethodDescriptionReturn the event which caused this to be fired, ornull
if this change was not caused by another event.Return an object which is to be the new value of some property, or is to be added to a collection.Return the old value of a property being changed.getType()
Find the type of this event.toString()
Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
ChangeEvent
Construct a ChangeEvent with no change details.- Parameters:
source
- The object being changed.type
- The type of change being made.
-
ChangeEvent
Construct a ChangeEvent specifying a new value for a property, or an object to be added to a collection.- Parameters:
source
- The object being changed.type
- The type of change being made.change
- The new value of the property being changed.
-
ChangeEvent
Construct a ChangeEvent specifying a new value for a property, and giving the previous value.- Parameters:
source
- The object being changed.type
- The type of change being made.change
- The new value of the property being changed.previous
- The old value of the property being changed.
-
ChangeEvent
public ChangeEvent(Object source, ChangeType type, Object change, Object previous, ChangeEvent chain) Construct a ChangeEvent to be fired because another ChangeEvent has been received from a property object.- Parameters:
source
- The object being changed.type
- The type of change being made.change
- The new value of the property being changed.previous
- The old value of the property being changed.chain
- The event which caused this event to be fired.
-
-
Method Details
-
getType
Find the type of this event.- Returns:
- The Type value
-
getChange
Return an object which is to be the new value of some property, or is to be added to a collection. May returnnull
is this is not meaningful.- Returns:
- The Change value
-
getPrevious
Return the old value of a property being changed. May returnnull
is this is not meaningful.- Returns:
- The Previous value
-
getChainedEvent
Return the event which caused this to be fired, ornull
if this change was not caused by another event.- Returns:
- The ChainedEvent value
-
toString
- Overrides:
toString
in classEventObject
-