net.sourceforge.nite.nom.link
Class DefaultEdit

java.lang.Object
  extended by net.sourceforge.nite.nom.link.DefaultEdit
All Implemented Interfaces:
NOMEdit

public class DefaultEdit
extends java.lang.Object
implements NOMEdit

A DefaultEdit is a single change to the NOM structure

Author:
jonathan

Field Summary
 
Fields inherited from interface net.sourceforge.nite.nom.link.NOMEdit
ADD_CHILD, ADD_ELEMENT, ADD_POINTER, DELETE_ELEMENT, DELETE_POINTER, EDIT_POINTER, REMOVE_CHILD, SET_ATTRIBUTE, SET_END_TIME, SET_START_TIME, SET_TEXT
 
Constructor Summary
DefaultEdit(NOMElement element, int edittype, java.lang.Object object)
           
 
Method Summary
 NOMElement getElement()
          The element on which the edit has taken place.
 java.lang.Object getObject()
          An Object that holds different things depending on the edit type.
 int getType()
          Returns the type of the edit made.
 java.lang.String toString()
          provides a textual description of the edit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultEdit

public DefaultEdit(NOMElement element,
                   int edittype,
                   java.lang.Object object)
Method Detail

getType

public int getType()
Returns the type of the edit made. Returns one of SET_ATTRIBUTE, ADD_ELEMENT, DELETE_ELEMENT, ADD_CHILD, REMOVE_CHILD, ADD_POINTER, EDIT_POINTER, DELETE_POINTER, SET_START_TIME, SET_END_TIME or SET_TEXT;

Specified by:
getType in interface NOMEdit

getElement

public NOMElement getElement()
The element on which the edit has taken place. NOTE: if the edit type is DELETE_ELEMENT, this will be the parent element, and getDetail will hold the deleted child. If the edit type is ADD_ELEMENT, this will be the added element itself.

Specified by:
getElement in interface NOMEdit

getObject

public java.lang.Object getObject()
An Object that holds different things depending on the edit type. If the edit type is DELETE_ELEMENT, this contains the deleted element. If the edit type is SET_ATTRIBUTE, this holds the Attribute. If a pointer has been added or deleted, this is the pointer.

Specified by:
getObject in interface NOMEdit

toString

public java.lang.String toString()
provides a textual description of the edit

Specified by:
toString in interface NOMEdit
Overrides:
toString in class java.lang.Object