|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tidy.TidyUtils
public final class TidyUtils
Utility class with handy methods, mainly for String handling or for reproducing c behaviours.
Method Summary | |
---|---|
static boolean |
findBadSubString(java.lang.String s,
java.lang.String p,
int len)
Return true if substring s is in p and isn't all in upper case. |
static char |
foldCase(char c,
boolean tocaps,
boolean xmlTags)
Fold case of a char. |
static byte[] |
getBytes(java.lang.String str)
Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods. |
static java.lang.String |
getString(byte[] bytes,
int offset,
int length)
Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods. |
static boolean |
isCharEncodingSupported(java.lang.String name)
Is the given character encoding supported? |
static boolean |
isDigit(char c)
Is the given char a digit? |
static boolean |
isLetter(char c)
Is the given char a letter? |
static boolean |
isLower(char c)
Determines if the specified character is a lowercase character. |
static boolean |
isNamechar(char c)
Is the given char valid in name? |
static boolean |
isUpper(char c)
Determines if the specified character is a uppercase character. |
static boolean |
isWhite(char c)
Determines if the specified character is whitespace. |
static int |
lastChar(java.lang.String str)
Return the last char in string. |
static char |
toLower(char c)
Maps the given character to its lowercase equivalent. |
static char |
toUpper(char c)
Maps the given character to its uppercase equivalent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean findBadSubString(java.lang.String s, java.lang.String p, int len)
s
- substringp
- full stringlen
- how many chars to check in p
public static byte[] getBytes(java.lang.String str)
str
- String
String.getBytes()
public static java.lang.String getString(byte[] bytes, int offset, int length)
bytes
- byte arrayoffset
- starting offset in byte arraylength
- length in byte array starting from offset
new String(bytes, offset, length, "UTF8")
public static int lastChar(java.lang.String str)
str
- String
public static boolean isWhite(char c)
c
- char
true
if char is whitespace.public static boolean isDigit(char c)
c
- char
true
if the given char is a digitpublic static boolean isLetter(char c)
c
- char
true
if the given char is a letterpublic static boolean isNamechar(char c)
c
- char
true
if char is a name char.public static boolean isLower(char c)
c
- char
true
if char is lower case.public static boolean isUpper(char c)
c
- char
true
if char is upper case.public static char toLower(char c)
c
- char
public static char toUpper(char c)
c
- char
public static char foldCase(char c, boolean tocaps, boolean xmlTags)
c
- chartocaps
- convert to capsxmlTags
- use xml tags? If true no change will be performed
public static boolean isCharEncodingSupported(java.lang.String name)
name
- character encoding name
true
if encoding is supported, false otherwhise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |