Package com.topologi.diffx.event.impl
Class SpaceEvent
java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
com.topologi.diffx.event.impl.CharactersEventBase
com.topologi.diffx.event.impl.SpaceEvent
- All Implemented Interfaces:
DiffXEvent,TextEvent,XMLFormattable,XMLWritable
A particular type of event reserved for white spaces.
- Version:
- 27 March 2010
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpaceEventA static instance for the double white spaces.static final SpaceEventA static instance for the new lines.static final SpaceEventA static instance for the single white spaces.static final SpaceEventA static instance for tabs.Fields inherited from class com.topologi.diffx.event.impl.DiffXEventBase
ESC, weight -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SpaceEventgetInstance(char c) Returns the white space event corresponding to the given string.static SpaceEventgetInstance(CharSequence space) Returns the white space event corresponding to the given string.toString()private static StringtoString(char[] chars) Returns the white space characters as a readable string.Methods inherited from class com.topologi.diffx.event.impl.CharactersEventBase
equals, getCharacters, hashCode, toXML, toXMLMethods 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
equals, getWeight, setWeightMethods inherited from interface com.topologi.diffx.event.TextEvent
getCharactersMethods inherited from interface com.topologi.diffx.xml.XMLFormattable
toXML, toXMLMethods inherited from interface com.topologi.diffx.xml.XMLWritable
toXML
-
Field Details
-
SINGLE_WHITESPACE
A static instance for the single white spaces.Use this constant instead of creating new instances
-
DOUBLE_WHITESPACE
A static instance for the double white spaces.Use this constant instead of creating new instances
-
NEW_LINE
A static instance for the new lines.Use this constant instead of creating new instances
-
TAB
A static instance for tabs.Use this constant instead of creating new instances
-
-
Constructor Details
-
SpaceEvent
Creates a new word event.- Parameters:
w- The word as a string.- Throws:
NullPointerException- If the given String isnull.
-
-
Method Details
-
toString
-
getInstance
Returns the white space event corresponding to the given string.- Parameters:
space- The string for the white space event.- Returns:
- A readable string.
-
getInstance
Returns the white space event corresponding to the given string.- Parameters:
c- The string for the white space event.- Returns:
- A readable string.
-
toString
Returns the white space characters as a readable string.- Parameters:
chars- The whitespace characters- Returns:
- A readable string.
-