com.topologi.diffx.event.DiffXEvent Maven / Gradle / Ivy
Show all versions of docx4j-diffx Show documentation
/*
* This file is part of the DiffX library.
*
* For licensing information please see the file license.txt included in the release.
* A copy of this licence can also be found at
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
package com.topologi.diffx.event;
import com.topologi.diffx.xml.XMLFormattable;
import com.topologi.diffx.xml.XMLWritable;
/**
* 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.
*
* @author Christophe Lauret
* @version 7 April 2005
*/
public interface DiffXEvent extends XMLWritable, XMLFormattable {
/**
* Indicates whether the specified event is equal to this event.
*
* @param e The event to compare it with thsi one.
*
* @return true
if considered equals;
* false
otherwise.
*/
boolean equals(DiffXEvent e);
/**
* Returns the weight of this event.
*
*
The default weight should be 1.
*
* @return The weight of this event.
*/
int getWeight();
/**
* 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.
*
* @param weight The weight of this event.
*/
void setWeight(int weight);
}