antsnest.datastructure
Class ChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by antsnest.datastructure.ChangeEvent
All Implemented Interfaces:
Serializable

public class ChangeEvent
extends EventObject

An event holding information about a change in an attribute/nested element

Author:
Chris Clohosy
See Also:
AntAttribute, AntElement, ChangeListener, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ChangeEvent(AntAttribute source)
          Constructs a new event, caused by an attribute
ChangeEvent(AntElement source, boolean added)
          Constructs a new event, caused by a nested element
 
Method Summary
 AntAttribute getAttribute()
          Gets the attribute that caused this event
 AntElement getElement()
          Gets the nested element that caused this event
 boolean wasAdded()
          Gets whether the element was added or removed
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChangeEvent

public ChangeEvent(AntAttribute source)
Constructs a new event, caused by an attribute

Parameters:
source - the attribute that caused the event

ChangeEvent

public ChangeEvent(AntElement source,
                   boolean added)
Constructs a new event, caused by a nested element

Parameters:
source - the element that caused the event
added - whether the element was added
Method Detail

getAttribute

public AntAttribute getAttribute()
Gets the attribute that caused this event

Returns:
an AntAttribute, the attribute

getElement

public AntElement getElement()
Gets the nested element that caused this event

Returns:
an AntElement, the element

wasAdded

public boolean wasAdded()
Gets whether the element was added or removed

Returns:
a boolean, whether the element was added