Class CommentEvent

java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
com.topologi.diffx.event.impl.CommentEvent
All Implemented Interfaces:
DiffXEvent, XMLFormattable, XMLWritable

public final class CommentEvent extends DiffXEventBase implements DiffXEvent
A comment event.
Version:
27 March 2010
  • Field Details

    • comment

      private final String comment
      The comment string.
    • hashCode

      private final int hashCode
      Hashcode value for this event.
  • Constructor Details

  • Method Details

    • getComment

      public String getComment()
      Returns the comment.
      Returns:
      the comment string.
    • hashCode

      public int hashCode()
      Description copied from class: DiffXEventBase
      Specified by:
      hashCode in class DiffXEventBase
    • equals

      public boolean equals(DiffXEvent e)
      Returns true if the event is a comment event.
      Specified by:
      equals in interface DiffXEvent
      Specified by:
      equals in class DiffXEventBase
      Parameters:
      e - The event to compare with this event.
      Returns:
      true if this event is equal to the specified event; false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXML

      public void toXML(XMLWriter xml) throws IOException
      Description copied from interface: XMLWritable
      Writes the XML representation of the implementing instance using the specified XMLWriter.
      Specified by:
      toXML in interface XMLWritable
      Parameters:
      xml - The XMLWriter to use.
      Throws:
      IOException - IF an I/O exception occurs whilst writing.
    • toXML

      public StringBuffer toXML(StringBuffer xml)
      Description copied from interface: XMLFormattable
      Appends 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:
      toXML in interface XMLFormattable
      Parameters:
      xml - The string buffer to which the XML representation is appended to.
      Returns:
      The modified string buffer.
    • toHashcode

      private int toHashcode(String comment)
      Calculates the hashcode for this event.
      Parameters:
      comment - The comment string.
      Returns:
      a number suitable as a hashcode.