public class StaticSymbolWhiteSpaceDefinitionStrategy extends AbstractWhiteSpaceFormattingStrategy
WhiteSpaceFormattingStrategy
implementation that is pre-configured with the set of symbols that may
be treated as white spaces.
Please note that this class exists just for performance reasons (functionally we can use
StaticTextWhiteSpaceDefinitionStrategy
with strings consisting from single symbol all the time).
Thread-safe.Constructor and Description |
---|
StaticSymbolWhiteSpaceDefinitionStrategy(char... whiteSpaceSymbols)
Creates new
StaticWhiteSpaceDefinitionStrategy object with the symbols that should be treated as white spaces. |
Modifier and Type | Method and Description |
---|---|
int |
check(java.lang.CharSequence text,
int start,
int end)
Checks if given sub-sequence of the given text contains symbols that may be treated as white spaces.
|
addWhitespace, adjustWhiteSpaceIfNecessary, adjustWhiteSpaceIfNecessary, containsWhitespacesOnly, replaceDefaultStrategy
public StaticSymbolWhiteSpaceDefinitionStrategy(char... whiteSpaceSymbols)
StaticWhiteSpaceDefinitionStrategy
object with the symbols that should be treated as white spaces.whiteSpaceSymbols
- symbols that should be treated as white spaces by the current strategypublic int check(java.lang.CharSequence text, int start, int end)
WhiteSpaceFormattingStrategy
text
- text to checkstart
- start offset to use with the given text (inclusive)end
- end offset to use with the given text (exclusive)[startOffset; endOffset)
range
and is not treated as white space by the current strategy or value that is greater
or equal to the given 'end'
parameter if all target sub-sequence symbols
can be treated as white spaces