Package monq.jfa
Class Misc
java.lang.Object
monq.jfa.Misc
Miscellaneous static functions.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic chardecodeEscape(IntSupplier chSource, Runnable unreadChar) Call this on a source of characters, given bychSource, which returns -1 to signal end of input.static Stringprintable(char ch) converts a character into something which can be printed on the consolestatic CharSequencestatic voidprintable(StringBuilder out, char ch)
-
Field Details
-
EBSATEOF
- See Also:
-
EEOFUNEX
- See Also:
-
ENOHEX
- See Also:
-
-
Method Details
-
printable
converts a character into something which can be printed on the console -
printable
-
printable
-
decodeEscape
Call this on a source of characters, given bychSource, which returns -1 to signal end of input. Typically the source has just delivered an escape character like backslash. The conversion of the next characters followsString.translateEscapes(). In addition '\uXXXX` and `\xXX` are decoded requiring exactly 4, respectively 2, hex digits.- Parameters:
chSource- to read characters from or -1 for end of inputunreadChar- sadly we may overread one character and must be able to hand it back- Returns:
- the decoded character
- Throws:
IOException- on end of input or an illegal character
-