本文整理匯總了Java中java.lang.Character.isISOControl方法的典型用法代碼示例。如果您正苦於以下問題:Java Character.isISOControl方法的具體用法?Java Character.isISOControl怎麽用?Java Character.isISOControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.lang.Character
的用法示例。
在下文中一共展示了Character.isISOControl方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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();
}
示例5: 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();
}
示例6: 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();
}