Package com.topologi.diffx.event.impl
Class ProcessingInstructionEvent
java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
com.topologi.diffx.event.impl.ProcessingInstructionEvent
- All Implemented Interfaces:
DiffXEvent,XMLFormattable,XMLWritable
A processing instruction event.
- Version:
- 27 March 2010
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe data of the processing instruction.private final intHashcode value for this event.private final StringThe target of the processing instruction.Fields inherited from class com.topologi.diffx.event.impl.DiffXEventBase
ESC, weight -
Constructor Summary
ConstructorsConstructorDescriptionProcessingInstructionEvent(String target, String data) Creates a new processing instruction event. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(DiffXEvent e) Returnstrueif the event is a processing instruction.getData()Returns the data of the processing instruction.Returns the target of the processing instruction.inthashCode()private static inttoHashCode(String s1, String s2) 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
-
target
The target of the processing instruction. -
data
The data of the processing instruction. -
hashCode
private final int hashCodeHashcode value for this event.
-
-
Constructor Details
-
ProcessingInstructionEvent
Creates a new processing instruction event.- Parameters:
target- The target of the processing instruction.data- The data of the processing instruction.- Throws:
NullPointerException- if any of the argument isnull.
-
-
Method Details
-
getTarget
Returns the target of the processing instruction.- Returns:
- The target of the processing instruction.
-
getData
Returns the data of the processing instruction.- Returns:
- The data of the processing instruction.
-
hashCode
public int hashCode()Description copied from class:DiffXEventBase- Specified by:
hashCodein classDiffXEventBase
-
equals
Returnstrueif the event is a processing instruction.- 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.
- Throws:
NullPointerException- if the specified character sequence isnull.
-
toHashCode
Calculates the hashcode for this event.- Parameters:
s1- A string to calculate the value from.s2- Another string to calculate the value from.- Returns:
- a number suitable as a hashcode.
-