本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: checkToken
@Override
public boolean checkToken(Token.ID... choices) {
return scanner.checkToken(choices);
}
示例6: addToken
private static YamlTokenFacade addToken(Token.ID token) {
YamlTokenFacade tokenFacade = new YamlTokenFacade(token);
tokens.put(token, tokenFacade);
return tokenFacade;
}
示例7: getIElementType
public static IElementType getIElementType(Token.ID token) {
return tokens.get(token);
}
示例8: YamlTokenFacade
public YamlTokenFacade(Token.ID token) {
super("[YAML Token] " + token.name(), YamlLanguage.INSTANCE);
}
示例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);
示例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);