本文整理汇总了Java中java.lang.Character.isSpaceChar方法的典型用法代码示例。如果您正苦于以下问题:Java Character.isSpaceChar方法的具体用法?Java Character.isSpaceChar怎么用?Java Character.isSpaceChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.Character
的用法示例。
在下文中一共展示了Character.isSpaceChar方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scanEscape
import java.lang.Character; //导入方法依赖的package包/类
private int scanEscape(int start, int n, char first)
throws URISyntaxException
{
int p = start;
char c = first;
if (c == '%') {
// Process escape pair
if ((p + 3 <= n)
&& match(charAt(p + 1), L_HEX, H_HEX)
&& match(charAt(p + 2), L_HEX, H_HEX)) {
return p + 3;
}
fail("Malformed escape pair", p);
} else if ((c > 128)
&& !Character.isSpaceChar(c)
&& !Character.isISOControl(c)) {
// Allow unescaped but visible non-US-ASCII chars
return p + 1;
}
return p;
}
示例2: scanEscape
import java.lang.Character; //导入方法依赖的package包/类
private int scanEscape(int start, int n, char first)
throws URISyntaxException
{
int p = start;
char c = first;
if (c == '%') {
// Process escape pair
if ((p + 3 <= n)
&& match(input.charAt(p + 1), L_HEX, H_HEX)
&& match(input.charAt(p + 2), L_HEX, H_HEX)) {
return p + 3;
}
fail("Malformed escape pair", p);
} else if ((c > 128)
&& !Character.isSpaceChar(c)
&& !Character.isISOControl(c)) {
// Allow unescaped but visible non-US-ASCII chars
return p + 1;
}
return p;
}
示例3: scanEscape
import java.lang.Character; //导入方法依赖的package包/类
private int scanEscape(int start, int n, char first)
throws URISyntaxException
{
int p = start;
char c = first;
if (c == '%') {
// Process escape pair
if ((p + 3 <= n)
&& match(charAt(p + 1), L_HEX, H_HEX)
&& match(charAt(p + 2), L_HEX, H_HEX)) {
return p + 3;
}
fail("Malformed escape pair", p);
} else if ((c > 128)
&& !Character.isSpaceChar(c)
&& !Character.isISOControl(c)) {
// Allow unescaped but visible non-US-ASCII chars
return p + 1;
}
return p;
}
示例4: appendQuoted
import java.lang.Character; //导入方法依赖的package包/类
static void appendQuoted(String chars, StringBuffer toAddTo) {
boolean inQuote = false;
char ch = chars.charAt(0);
if (Character.isSpaceChar(ch)) {
inQuote = true;
toAddTo.append('\'');
} else {
if (PatternEntry.isSpecialChar(ch)) {
inQuote = true;
toAddTo.append('\'');
} else {
switch (ch) {
case 0x0010: case '\f': case '\r':
case '\t': case '\n': case '@':
inQuote = true;
toAddTo.append('\'');
break;
case '\'':
inQuote = true;
toAddTo.append('\'');
break;
default:
if (inQuote) {
inQuote = false; toAddTo.append('\'');
}
break;
}
}
}
toAddTo.append(chars);
if (inQuote)
toAddTo.append('\'');
}
示例5: quote
import java.lang.Character; //导入方法依赖的package包/类
private static String quote(String s, long lowMask, long highMask) {
int n = s.length();
StringBuffer sb = null;
boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0);
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c < '\u0080') {
if (!match(c, lowMask, highMask)) {
if (sb == null) {
sb = new StringBuffer();
sb.append(s.substring(0, i));
}
appendEscape(sb, (byte)c);
} else {
if (sb != null)
sb.append(c);
}
} else if (allowNonASCII
&& (Character.isSpaceChar(c)
|| Character.isISOControl(c))) {
if (sb == null) {
sb = new StringBuffer();
sb.append(s.substring(0, i));
}
appendEncoded(sb, c);
} else {
if (sb != null)
sb.append(c);
}
}
return (sb == null) ? s : sb.toString();
}
示例6: quote
import java.lang.Character; //导入方法依赖的package包/类
private static String quote(String s, long lowMask, long highMask) {
StringBuilder sb = null;
boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0);
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c < '\u0080') {
if (!match(c, lowMask, highMask)) {
if (sb == null) {
sb = new StringBuilder();
sb.append(s, 0, i);
}
appendEscape(sb, (byte)c);
} else {
if (sb != null)
sb.append(c);
}
} else if (allowNonASCII
&& (Character.isSpaceChar(c)
|| Character.isISOControl(c))) {
if (sb == null) {
sb = new StringBuilder();
sb.append(s, 0, i);
}
appendEncoded(sb, c);
} else {
if (sb != null)
sb.append(c);
}
}
return (sb == null) ? s : sb.toString();
}
示例7: quote
import java.lang.Character; //导入方法依赖的package包/类
private static String quote(String s, long lowMask, long highMask) {
int n = s.length();
StringBuffer sb = null;
boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0);
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c < '\u0080') {
if (!match(c, lowMask, highMask)) {
if (sb == null) {
sb = new StringBuffer();
sb.append(s.substring(0, i));
}
appendEscape(sb, (byte)c);
} else {
if (sb != null)
sb.append(c);
}
} else if (allowNonASCII
&& (Character.isSpaceChar(c)
|| Character.isISOControl(c))) {
if (sb == null) {
sb = new StringBuffer();
sb.append(s.substring(0, i));
}
appendEncoded(sb, c);
} else {
if (sb != null)
sb.append(c);
}
}
return (sb == null) ? s : sb.toString();
}