|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.topologi.diffx.event.impl.IgnorableSpaceEvent
A particular type of event reserved for ignored white spaces.
This class can be used to ignore whitespaces for processing but preserve them for formatting. This event keeps the exact formatting of the white space henceby preserving it, but will consider any instances of this class to be equal regardless of their actual formatting so that the algorithm ignores the differences.
| Constructor Summary | |
IgnorableSpaceEvent(CharSequence seq)
Creates a new ignorable white space event. |
|
| Method Summary | |
boolean |
equals(DiffXEvent e)
Returns true if the event is an ignorable white space, regardless
of the characters that it matches. |
String |
getCharacters()
Returns the characters that this event represents. |
int |
getWeight()
Returns the weight of this event. |
int |
hashCode()
Always return the same value. |
void |
setWeight(int weight)
Ignored. |
String |
toString()
|
String |
toXML()
Returns a xml representation of the object of the implementing class. |
StringBuffer |
toXML(StringBuffer xml)
Appends the XML representation of the object of the implementing class. |
void |
toXML(XMLWriter xml)
Writes the XML representation of the implementing instance using the specified XMLWriter. |
| Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public IgnorableSpaceEvent(CharSequence seq)
throws NullPointerException
seq - The char sequence.
NullPointerException - If the given String is null.| Method Detail |
public String toString()
Object.toString()public int hashCode()
Object.hashCode()public boolean equals(DiffXEvent e)
true if the event is an ignorable white space, regardless
of the characters that it matches.
equals in interface DiffXEvente - The event to compare with this event.
true if considered equal;
false otherwise.public String getCharacters()
Note: this method will return the characters as used by Java (ie. Unicode), they may not be suitable for writing to an XML string.
getCharacters in interface TextEvent
public void toXML(XMLWriter xml)
throws IOException
XMLWritableXMLWriter.
toXML in interface XMLWritablexml - The XMLWriter to use.
IOException - IF an I/O exception occurs whilst writing.XMLWritable.toXML(com.topologi.diffx.xml.XMLWriter)public String toXML()
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 toXML method:
return this.toXML(new StringBuffer()).toString();
toXML in interface XMLFormattableXMLFormattable.toXML()
public StringBuffer toXML(StringBuffer xml)
throws NullPointerException
XMLFormattableImplementations must ensure that the returned string buffer is the same object as the specified string buffer.
toXML in interface XMLFormattablexml - The string buffer to which the XML representation is appended to.
NullPointerException - if the specified character sequence is null.XMLWritable.toXML(com.topologi.diffx.xml.XMLWriter)public int getWeight()
DiffXEventThe default weight should be 1.
getWeight in interface DiffXEventDiffXEvent.getWeight()public void setWeight(int weight)
setWeight in interface DiffXEventweight - The weight of this event.DiffXEvent.setWeight(int)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||