com.topologi.diffx.event
Interface DiffXEvent

All Superinterfaces:
XMLFormattable, XMLWritable
All Known Subinterfaces:
AttributeEvent, CloseElementEvent, OpenElementEvent, TextEvent
All Known Implementing Classes:
AttributeEventImpl, AttributeEventNSImpl, CharactersEvent, CharactersEventBase, CharEvent, CloseElementEventImpl, CloseElementEventNSImpl, CommentEvent, IgnorableSpaceEvent, LineEvent, OpenElementEventImpl, OpenElementEventNSImpl, ProcessingInstructionEvent, SpaceEvent, WordEvent, XMLBranchEvent

public interface DiffXEvent
extends XMLWritable, XMLFormattable

Defines and event that can be processed by DiffX.

The main characteristics of a Diff-X event is that it can be compared for equality with another Diff-X event.

Events can be associated with a weight that can be used or ignored by an algorithm. The more weight the less likely an event will be considered to have been modified. The weight can change depending on the algorithm or configuration used.

For convenience, this interface extends the XMLWritable and XMLFormattable in order to turn an event into XML easily. This may change in the future, if the impact on performance is too heavy.

Version:
7 April 2005
Author:
Christophe Lauret

Method Summary
 boolean equals(DiffXEvent e)
          Indicates whether the specified event is equal to this event.
 int getWeight()
          Returns the weight of this event.
 void setWeight(int weight)
          Sets the weight of this event.
 
Methods inherited from interface com.topologi.diffx.xml.XMLWritable
toXML
 
Methods inherited from interface com.topologi.diffx.xml.XMLFormattable
toXML, toXML
 

Method Detail

equals

boolean equals(DiffXEvent e)
Indicates whether the specified event is equal to this event.

Parameters:
e - The event to compare it with thsi one.
Returns:
true if considered equals; false otherwise.

getWeight

int getWeight()
Returns the weight of this event.

The default weight should be 1.

Returns:
The weight of this event.

setWeight

void setWeight(int weight)
Sets the weight of this event.

This method is intended for use by algorithms, optimisers and loaders in order to adjust the importance of an event.

Parameters:
weight - The weight of this event.