本文整理汇总了Java中com.github.javaparser.ast.expr.DoubleLiteralExpr类的典型用法代码示例。如果您正苦于以下问题:Java DoubleLiteralExpr类的具体用法?Java DoubleLiteralExpr怎么用?Java DoubleLiteralExpr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoubleLiteralExpr类属于com.github.javaparser.ast.expr包,在下文中一共展示了DoubleLiteralExpr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractType
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
protected IsType extractType(Expression val) {
if (val instanceof LiteralExpr) {
if (val instanceof IntegerLiteralExpr) {
return new ImmutableType("", "int");
} else if (val instanceof LongLiteralExpr) {
return new ImmutableType("", "long");
} else if (val instanceof DoubleLiteralExpr) {
return new ImmutableType("", "double");
} else if (val instanceof CharLiteralExpr) {
return new ImmutableType("", "char");
} else if (val instanceof BooleanLiteralExpr) {
return new ImmutableType("", "boolean");
} else if (val instanceof StringLiteralExpr) {
return new ImmutableType("java.lang", "String");
}
// TODO: arrays, ui containers, annotated elements, constructors, etc...
}
return new ImmutableType("java.lang", "Object");
}
示例2: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public JCTree visit(final DoubleLiteralExpr n, final Object arg) {
//ARG0: Object value
Double arg0 = new Double(n.getValue());
return new AJCLiteral(make.Literal(arg0), ((n.getComment() != null) ? n.getComment().getContent() : null));
}
示例3: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override public Boolean visit(final DoubleLiteralExpr n1, final Node arg) {
final DoubleLiteralExpr n2 = (DoubleLiteralExpr) arg;
if (!objEquals(n1.getValue(), n2.getValue())) {
return false;
}
return true;
}
示例4: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public Node visit(DoubleLiteralExpr _n, Object _arg) {
Comment comment = cloneNodes(_n.getComment(), _arg);
DoubleLiteralExpr r = new DoubleLiteralExpr(
_n.getRange(),
_n.getValue()
);
r.setComment(comment);
return r;
}
示例5: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public void visit(DoubleLiteralExpr n, Script arg) {
}
示例6: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public void visit(final DoubleLiteralExpr n, final Object arg) {
printer.printLn("DoubleLiteralExpr");
printJavaComment(n.getComment(), arg);
printer.print(n.getValue());
}
示例7: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override public Node visit(final DoubleLiteralExpr n, final A arg) {
return n;
}
示例8: PrimitiveDefaultValue
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
public PrimitiveDefaultValue(PrimitiveType type) {
super("", type.getType().name());
this.type = type;
switch (type.getType()) {
case Boolean:
this.viewValue = "CHECKBOX";
this.domainValue = createDomainValueExpression(
new BooleanLiteralExpr(true),
new BooleanLiteralExpr(false)
);
break;
case Int:
this.viewValue = "TEXT";
this.domainValue = createDomainValueExpression(
new IntegerLiteralExpr("Integer.MIN_VALUE"),
new IntegerLiteralExpr("Integer.MAX_VALUE")
);
break;
case Float:
this.viewValue = "TEXT";
this.domainValue = createDomainValueExpression(
new DoubleLiteralExpr("-Float.MAX_VALUE"),
new DoubleLiteralExpr("Float.MAX_VALUE")
);
break;
case Double:
this.viewValue = "TEXT";
this.domainValue = createDomainValueExpression(
new DoubleLiteralExpr("-Double.MAX_VALUE"),
new DoubleLiteralExpr("Double.MAX_VALUE")
);
break;
case Char:
this.viewValue = "TEXT";
this.domainValue = createDomainValueExpression(
new CharLiteralExpr(Character.toString(Character.MIN_VALUE)),
new CharLiteralExpr(Character.toString(Character.MAX_VALUE))
);
break;
default:
throw new UnsupportedOperationException("Type " + type.getType() + " is not supported.");
}
}
示例9: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override public void visit(final DoubleLiteralExpr n, final A arg) {
visitComment(n.getComment(), arg);
}
示例10: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override public Node visit(final DoubleLiteralExpr n, final A arg) {
visitComment(n, arg);
return n;
}
示例11: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public Object visit(final DoubleLiteralExpr n, final Context arg) {
return Double.parseDouble(n.getValue());
}
示例12: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public void visit(final DoubleLiteralExpr n, final Context ctx) {
visitNode(n, ctx);
super.visit(n, ctx);
}
示例13: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public Type visit(final DoubleLiteralExpr n, final Context arg) {
return double.class;
}
示例14: visit
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override
public void visit(DoubleLiteralExpr n, Void arg) {
out.println("DoubleLiteralExpr: " + (extended ? n : n));
super.visit(n, arg);
}
示例15: doMerge
import com.github.javaparser.ast.expr.DoubleLiteralExpr; //导入依赖的package包/类
@Override public DoubleLiteralExpr doMerge(DoubleLiteralExpr first, DoubleLiteralExpr second) {
DoubleLiteralExpr dle = new DoubleLiteralExpr();
dle.setValue(first.getValue());
return dle;
}