Package com.topologi.diffx.event.impl
Class CommentEvent
java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
com.topologi.diffx.event.impl.CommentEvent
- All Implemented Interfaces:
DiffXEvent,XMLFormattable,XMLWritable
A comment event.
- Version:
- 27 March 2010
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe comment string.private final intHashcode value for this event.Fields inherited from class com.topologi.diffx.event.impl.DiffXEventBase
ESC, weight -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(DiffXEvent e) Returnstrueif the event is a comment event.Returns the comment.inthashCode()private inttoHashcode(String comment) Calculates the hashcode for this event.toString()voidWrites the XML representation of the implementing instance using the specifiedXMLWriter.toXML(StringBuffer xml) Appends the XML representation of the object of the implementing class.Methods inherited from class com.topologi.diffx.event.impl.DiffXEventBase
equals, getWeight, setWeight, toXMLMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.topologi.diffx.event.DiffXEvent
getWeight, setWeightMethods inherited from interface com.topologi.diffx.xml.XMLFormattable
toXML
-
Field Details
-
comment
The comment string. -
hashCode
private final int hashCodeHashcode value for this event.
-
-
Constructor Details
-
CommentEvent
Creates a new comment event.- Parameters:
comment- the comment string.- Throws:
NullPointerException- if any of the argument isnull.
-
-
Method Details
-
getComment
Returns the comment.- Returns:
- the comment string.
-
hashCode
public int hashCode()Description copied from class:DiffXEventBase- Specified by:
hashCodein classDiffXEventBase
-
equals
Returnstrueif the event is a comment event.- Specified by:
equalsin interfaceDiffXEvent- Specified by:
equalsin classDiffXEventBase- Parameters:
e- The event to compare with this event.- Returns:
trueif this event is equal to the specified event;falseotherwise.
-
toString
-
toXML
Description copied from interface:XMLWritableWrites the XML representation of the implementing instance using the specifiedXMLWriter.- Specified by:
toXMLin interfaceXMLWritable- Parameters:
xml- The XMLWriter to use.- Throws:
IOException- IF an I/O exception occurs whilst writing.
-
toXML
Description copied from interface:XMLFormattableAppends the XML representation of the object of the implementing class.Implementations must ensure that the returned string buffer is the same object as the specified string buffer.
- Specified by:
toXMLin interfaceXMLFormattable- Parameters:
xml- The string buffer to which the XML representation is appended to.- Returns:
- The modified string buffer.
-
toHashcode
Calculates the hashcode for this event.- Parameters:
comment- The comment string.- Returns:
- a number suitable as a hashcode.
-