Package com.topologi.diffx.event.impl
Class DiffXEventBase
java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
- All Implemented Interfaces:
DiffXEvent,XMLFormattable,XMLWritable
- Direct Known Subclasses:
AttributeEventImpl,AttributeEventNSImpl,CharactersEventBase,CharEvent,CloseElementEventImpl,CloseElementEventNSImpl,CommentEvent,LineEvent,OpenElementEventImpl,OpenElementEventNSImpl,ProcessingInstructionEvent,XMLBranchEvent
A base class for DiffX events.
This class is purely provided for convenience and consistency, it is best, althouhg not strictly
required, that most DiffXEvent implementations extend this class.
- Version:
- 3 February 2005
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanequals(DiffXEvent e) Indicates whether the specified event is equal to this event.final booleanInvokes theDiffXEvent.equals(DiffXEvent)method if the specified object if notnulland is an instance ofDiffXEvent.intReturns the weight of this event.abstract inthashCode()voidsetWeight(int weight) Sets the weight of this event.toXML()Returns a xml representation of the object of the implementing class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.topologi.diffx.xml.XMLFormattable
toXMLMethods inherited from interface com.topologi.diffx.xml.XMLWritable
toXML
-
Field Details
-
ESC
For use by the events to escape XML chars. -
weight
int weight
-
-
Constructor Details
-
DiffXEventBase
DiffXEventBase()
-
-
Method Details
-
hashCode
public abstract int hashCode() -
equals
Indicates whether the specified event is equal to this event.- Specified by:
equalsin interfaceDiffXEvent- Parameters:
e- The event to compare it with thsi one.- Returns:
trueif considered equals;falseotherwise.
-
equals
Invokes theDiffXEvent.equals(DiffXEvent)method if the specified object if notnulland is an instance ofDiffXEvent. -
toXML
Description copied from interface:XMLFormattableReturns a xml representation of the object of the implementing class.
Most implementation should use the following code to ensure consistent data with the other
toXMLmethod:return this.toXML(new StringBuffer()).toString();
- Specified by:
toXMLin interfaceXMLFormattable- Returns:
- a XML representation of the object of the implementing class.
-
getWeight
public int getWeight()Description copied from interface:DiffXEventReturns the weight of this event.The default weight should be 1.
- Specified by:
getWeightin interfaceDiffXEvent- Returns:
- The weight of this event.
-
setWeight
public void setWeight(int weight) Description copied from interface:DiffXEventSets 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.
- Specified by:
setWeightin interfaceDiffXEvent- Parameters:
weight- The weight of this event.
-