net.sourceforge.nite.nom.link
Interface NOMEdit

All Known Implementing Classes:
DefaultEdit

public interface NOMEdit

A NOMEdit is a single change to the NOM structure. Edits are always taken to be related to a specific NOMElement (which is returned by the getElement() method)

Author:
jonathan

Field Summary
static int ADD_CHILD
           
static int ADD_ELEMENT
           
static int ADD_POINTER
           
static int DELETE_ELEMENT
           
static int DELETE_POINTER
           
static int EDIT_POINTER
           
static int REMOVE_CHILD
           
static int SET_ATTRIBUTE
           
static int SET_END_TIME
           
static int SET_START_TIME
           
static int SET_TEXT
           
 
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
 

Field Detail

SET_ATTRIBUTE

static final int SET_ATTRIBUTE
See Also:
Constant Field Values

ADD_ELEMENT

static final int ADD_ELEMENT
See Also:
Constant Field Values

DELETE_ELEMENT

static final int DELETE_ELEMENT
See Also:
Constant Field Values

ADD_CHILD

static final int ADD_CHILD
See Also:
Constant Field Values

REMOVE_CHILD

static final int REMOVE_CHILD
See Also:
Constant Field Values

ADD_POINTER

static final int ADD_POINTER
See Also:
Constant Field Values

EDIT_POINTER

static final int EDIT_POINTER
See Also:
Constant Field Values

DELETE_POINTER

static final int DELETE_POINTER
See Also:
Constant Field Values

SET_START_TIME

static final int SET_START_TIME
See Also:
Constant Field Values

SET_END_TIME

static final int SET_END_TIME
See Also:
Constant Field Values

SET_TEXT

static final int SET_TEXT
See Also:
Constant Field Values
Method Detail

getType

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;


getElement

NOMElement getElement()
The element on which the edit has taken place. This will be the parent element of any deleted child or of any added child, rather than the newly added or deleted child (which will be available via getObject()). For setting attributes this returns the element to which the attribute belongs with getObject returning a string (the edited attribute name). For adding and deleting pointers, this returns the element from which the pointer points and getObject() returns the pointer that has been added or removed.


getObject

java.lang.Object getObject()
An Object that holds different things depending on the edit type. When Adding / deleting pointers this returns the pointer. For setting start and end times this returns null. For setting other attributes this returns the attribute name. For adding / deleting children, this returns the child


toString

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

Overrides:
toString in class java.lang.Object