当前位置: 首页>>代码示例>>Java>>正文


Java Character.isSpaceChar方法代码示例

本文整理汇总了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;
}
 
开发者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: 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('\'');
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:PatternEntry.java

示例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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:URI.java

示例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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:URI.java

示例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();
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:33,代码来源:URI.java


注:本文中的java.lang.Character.isSpaceChar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。