當前位置: 首頁>>代碼示例>>Java>>正文


Java Character.isISOControl方法代碼示例

本文整理匯總了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;
}
 
開發者ID:alexkasko,項目名稱:openjdk-icedtea7,代碼行數:22,代碼來源:URI.java

示例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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:22,代碼來源:URI.java

示例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;
}
 
開發者ID:jgaltidor,項目名稱:VarJ,代碼行數:22,代碼來源:URI.java

示例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();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:33,代碼來源:URI.java

示例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();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:32,代碼來源:URI.java

示例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();
   }
 
開發者ID:jgaltidor,項目名稱:VarJ,代碼行數:33,代碼來源:URI.java


注:本文中的java.lang.Character.isISOControl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。