net.jinx.db
Class HierarchyEvent

java.lang.Object
  extended by net.jinx.db.HierarchyEvent

public class HierarchyEvent
extends java.lang.Object

HierarchyEvent objects are fired when a Hierarchy is modified.

API Stability: Stable.


Field Summary
static int ATTR_ADD
          Signals that an attribute has been added.
static int ATTR_CHANGE
          Signals that a pre-existing attribute has been changed.
static int ATTR_CLEAR
          Signals that the source's attributes have all been removed.
static int ATTR_REMOVE
          Signals that an attribute has been removed.
static int NODE_ADD
          Signals that a node has been added.
static int NODE_CLEAR
          Signals that the source's nodes have all been removed.
static int NODE_REMOVE
          Signals that an node has been removed.
 
Constructor Summary
HierarchyEvent(Hierarchy source, java.lang.String target, int event)
          Constructs a new HierarchyEvent.
 
Method Summary
 Hierarchy getSource()
          Provides the Hierarchy object that this event came from.
 java.lang.String getTarget()
          Provides the name of the node or attribute that was altered.
 int getType()
          This provides the type of change that occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_ADD

public static final int ATTR_ADD
Signals that an attribute has been added.

See Also:
Constant Field Values

ATTR_REMOVE

public static final int ATTR_REMOVE
Signals that an attribute has been removed.

See Also:
Constant Field Values

ATTR_CHANGE

public static final int ATTR_CHANGE
Signals that a pre-existing attribute has been changed.

See Also:
Constant Field Values

NODE_ADD

public static final int NODE_ADD
Signals that a node has been added.

See Also:
Constant Field Values

NODE_REMOVE

public static final int NODE_REMOVE
Signals that an node has been removed.

See Also:
Constant Field Values

ATTR_CLEAR

public static final int ATTR_CLEAR
Signals that the source's attributes have all been removed.

See Also:
Constant Field Values

NODE_CLEAR

public static final int NODE_CLEAR
Signals that the source's nodes have all been removed.

See Also:
Constant Field Values
Constructor Detail

HierarchyEvent

public HierarchyEvent(Hierarchy source,
                      java.lang.String target,
                      int event)
Constructs a new HierarchyEvent.

Parameters:
source - the Hierarchy that the change occured on.
target - the name of the node or attribute that's been modified. If the change is a modification of source itself, this can be null.
event - the event constant from this class. This describes what exactly happened.
Method Detail

getSource

public Hierarchy getSource()
Provides the Hierarchy object that this event came from.

Returns:
the Hierarchy.

getTarget

public java.lang.String getTarget()
Provides the name of the node or attribute that was altered.

Returns:
the String name. If the change was a change to the Hierarchy itself or it affects more than one attribute/node, then this will be null.

getType

public int getType()
This provides the type of change that occured.

Returns:
one of the constants in this class.