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


Java Token.ID属性代码示例

本文整理汇总了Java中org.yaml.snakeyaml.tokens.Token.ID属性的典型用法代码示例。如果您正苦于以下问题:Java Token.ID属性的具体用法?Java Token.ID怎么用?Java Token.ID使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.yaml.snakeyaml.tokens.Token的用法示例。


在下文中一共展示了Token.ID属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkToken

/**
 * Check whether the next token is one of the given types.
 */
public boolean checkToken(Token.ID... choices) {
    while (needMoreTokens()) {
        fetchMoreTokens();
    }
    if (!this.tokens.isEmpty()) {
        if (choices.length == 0) {
            return true;
        }
        // since profiler puts this method on top (it is used a lot), we
        // should not use 'foreach' here because of the performance reasons
        Token.ID first = this.tokens.get(0).getTokenId();
        for (int i = 0; i < choices.length; i++) {
            if (first == choices[i]) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:22,代码来源:ScannerImpl.java

示例2: checkToken

public boolean checkToken(Token.ID... choices) {
    if (!scanned) {
        scan();
    }
    if (!tokens.isEmpty()) {
        if (choices.length == 0) {
            return true;
        }
        Token first = this.tokens.get(0);
        for (Token.ID choice : choices) {
            if (first.getTokenId() == choice) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:17,代码来源:CanonicalScanner.java

示例3: checkToken

/**
 * Check whether the next token is one of the given types.
 */
@Override
public boolean checkToken(final Token.ID... choices) {
	while (needMoreTokens()) {
		fetchMoreTokens();
	}
	if (!this.tokens.isEmpty()) {
		if (choices.length == 0) {
			return true;
		}
		// since profiler puts this method on top (it is used a lot), we
		// should not use 'foreach' here because of the performance reasons
		Token.ID first = this.tokens.get(0).getTokenId();
		for (int i = 0; i < choices.length; i++) {
			if (first == choices[i]) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:23,代码来源:ScannerImpl.java

示例4: getToken

public Token getToken(Token.ID choice) {
    Token token = getToken();
    if (choice != null && token.getTokenId() != choice) {
        throw new CanonicalException("unexpected token " + token);
    }
    return token;
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:7,代码来源:CanonicalScanner.java

示例5: checkToken

@Override
public boolean checkToken(Token.ID... choices) {
    return scanner.checkToken(choices);
}
 
开发者ID:vermut,项目名称:intellij-snakeyaml,代码行数:4,代码来源:ErrorSkippingScanner.java

示例6: addToken

private static YamlTokenFacade addToken(Token.ID token) {
    YamlTokenFacade tokenFacade = new YamlTokenFacade(token);
    tokens.put(token, tokenFacade);
    return tokenFacade;
}
 
开发者ID:vermut,项目名称:intellij-snakeyaml,代码行数:5,代码来源:YamlTokenTypes.java

示例7: getIElementType

public static IElementType getIElementType(Token.ID token) {
    return tokens.get(token);
}
 
开发者ID:vermut,项目名称:intellij-snakeyaml,代码行数:3,代码来源:YamlTokenTypes.java

示例8: YamlTokenFacade

public YamlTokenFacade(Token.ID token) {
    super("[YAML Token] " + token.name(), YamlLanguage.INSTANCE);
}
 
开发者ID:vermut,项目名称:intellij-snakeyaml,代码行数:3,代码来源:YamlTokenFacade.java

示例9: checkToken

/**
 * Check if the next token is one of the given types.
 * 
 * @param choices
 *            token IDs.
 * @return <code>true</code> if the next token can be assigned to a variable
 *         of at least one of the given types. Returns <code>false</code> if
 *         no more tokens are available.
 * @throws ScannerException
 *             Thrown in case of malformed input.
 */
boolean checkToken(Token.ID... choices);
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:12,代码来源:Scanner.java

示例10: checkToken

/**
 * Check if the next token is one of the given types.
 *
 * @param choices token IDs.
 * @return <code>true</code> if the next token can be assigned to a variable
 * of at least one of the given types. Returns <code>false</code> if
 * no more tokens are available.
 * @throws ScannerException Thrown in case of malformed input.
 */
boolean checkToken(Token.ID... choices);
 
开发者ID:vermut,项目名称:intellij-snakeyaml,代码行数:10,代码来源:ScannerEx.java


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