本文整理汇总了Java中org.javarosa.xpath.parser.Token.NUM属性的典型用法代码示例。如果您正苦于以下问题:Java Token.NUM属性的具体用法?Java Token.NUM怎么用?Java Token.NUM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.javarosa.xpath.parser.Token
的用法示例。
在下文中一共展示了Token.NUM属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
public XPathExpression build() throws XPathSyntaxException {
if (content.size() == 1) {
if (getType(0) == CHILD) {
return ((ASTNode)content.elementAt(0)).build();
} else {
switch (getTokenType(0)) {
case Token.NUM: return new XPathNumericLiteral((Double)getToken(0).val);
case Token.STR: return new XPathStringLiteral((String)getToken(0).val);
case Token.VAR: return new XPathVariableReference((XPathQName)getToken(0).val);
default: throw new XPathSyntaxException();
}
}
} else {
throw new XPathSyntaxException();
}
}
示例2: build
public XPathExpression build() throws XPathSyntaxException {
if (content.size() == 1) {
if (getType(0) == CHILD) {
return ((ASTNode)content.elementAt(0)).build();
} else {
switch (getTokenType(0)) {
case Token.NUM:
return new XPathNumericLiteral((Double)getToken(0).val);
case Token.STR:
return new XPathStringLiteral((String)getToken(0).val);
case Token.VAR:
return new XPathVariableReference((XPathQName)getToken(0).val);
default:
throw new XPathSyntaxException();
}
}
} else {
throw new XPathSyntaxException();
}
}
示例3: build
@Override
public XPathExpression build() throws XPathSyntaxException {
if (size() == 1) {
if (getType(0) == CHILD) {
return ((ASTNode)content.get(0)).build();
} else {
switch (getTokenType(0)) {
case Token.NUM:
return new XPathNumericLiteral((Double)getToken(0).val);
case Token.STR:
return new XPathStringLiteral((String)getToken(0).val);
case Token.VAR:
return new XPathVariableReference((XPathQName)getToken(0).val);
default:
throw new XPathSyntaxException();
}
}
} else {
throw new XPathSyntaxException();
}
}
示例4: isTerminal
public boolean isTerminal () {
if (content.size() == 1) {
int type = getTokenType(0);
return (type == Token.NUM || type == Token.STR || type == Token.VAR);
} else {
return false;
}
}
示例5: isTerminal
public boolean isTerminal() {
if (content.size() == 1) {
int type = getTokenType(0);
return (type == Token.NUM || type == Token.STR || type == Token.VAR);
} else {
return false;
}
}
示例6: isTerminal
private boolean isTerminal() {
if (size() == 1) {
int type = getTokenType(0);
return (type == Token.NUM || type == Token.STR || type == Token.VAR);
} else {
return false;
}
}