Class ChangeEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class ChangeEvent
    extends java.util.EventObject
    Event which encapsulates a change in any mutable BioJava object.
    Since:
    1.1
    Author:
    Thomas Down, Matthew Pocock, Greg Cox
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      ChangeEvent​(java.lang.Object source, ChangeType type)
      Construct a ChangeEvent with no change details.
      ChangeEvent​(java.lang.Object source, ChangeType type, java.lang.Object change)
      Construct a ChangeEvent specifying a new value for a property, or an object to be added to a collection.
      ChangeEvent​(java.lang.Object source, ChangeType type, java.lang.Object change, java.lang.Object previous)
      Construct a ChangeEvent specifying a new value for a property, and giving the previous value.
      ChangeEvent​(java.lang.Object source, ChangeType type, java.lang.Object change, java.lang.Object previous, ChangeEvent chain)
      Construct a ChangeEvent to be fired because another ChangeEvent has been received from a property object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ChangeEvent getChainedEvent()
      Return the event which caused this to be fired, or null if this change was not caused by another event.
      java.lang.Object getChange()
      Return an object which is to be the new value of some property, or is to be added to a collection.
      java.lang.Object getPrevious()
      Return the old value of a property being changed.
      ChangeType getType()
      Find the type of this event.
      java.lang.String toString()  
      • Methods inherited from class java.util.EventObject

        getSource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ChangeEvent

        public ChangeEvent​(java.lang.Object source,
                           ChangeType type)
        Construct a ChangeEvent with no change details.
        Parameters:
        source - The object being changed.
        type - The type of change being made.
      • ChangeEvent

        public ChangeEvent​(java.lang.Object source,
                           ChangeType type,
                           java.lang.Object change)
        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

        public ChangeEvent​(java.lang.Object source,
                           ChangeType type,
                           java.lang.Object change,
                           java.lang.Object previous)
        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​(java.lang.Object source,
                           ChangeType type,
                           java.lang.Object change,
                           java.lang.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 Detail

      • getType

        public ChangeType getType()
        Find the type of this event.
        Returns:
        The Type value
      • getChange

        public java.lang.Object getChange()
        Return an object which is to be the new value of some property, or is to be added to a collection. May return null is this is not meaningful.
        Returns:
        The Change value
      • getPrevious

        public java.lang.Object getPrevious()
        Return the old value of a property being changed. May return null is this is not meaningful.
        Returns:
        The Previous value
      • getChainedEvent

        public ChangeEvent getChainedEvent()
        Return the event which caused this to be fired, or null if this change was not caused by another event.
        Returns:
        The ChainedEvent value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.EventObject