Home
last modified time | relevance | path

Searched refs:addStatement (Results 1 – 25 of 46) sorted by relevance

12

/external/javapoet/src/test/java/com/squareup/javapoet/
DJavaFileTest.java40 .addStatement("$T result = new $T<>()", listOfHoverboards, arrayList) in importStaticReadmeExample()
41 .addStatement("result.add($T.createNimbus(2000))", hoverboard) in importStaticReadmeExample()
42 .addStatement("result.add($T.createNimbus(\"2001\"))", hoverboard) in importStaticReadmeExample()
43 .addStatement("result.add($T.createNimbus($T.THUNDERBOLT))", hoverboard, namedBoards) in importStaticReadmeExample()
44 .addStatement("$T.sort(result)", Collections.class) in importStaticReadmeExample()
45 .addStatement("return result.isEmpty() ? $T.emptyList() : result", Collections.class) in importStaticReadmeExample()
82 .addStatement("$T", Runtime.class) in importStaticForCrazyFormatsWorks()
83 .addStatement("$T.a()", Runtime.class) in importStaticForCrazyFormatsWorks()
84 .addStatement("$T.X", Runtime.class) in importStaticForCrazyFormatsWorks()
85 .addStatement("$T$T", Runtime.class, Runtime.class) in importStaticForCrazyFormatsWorks()
[all …]
DTypeSpecTest.java856 .addCode(CodeBlock.builder().addStatement("return 0").build()) in classCannotHaveDefaultMethods()
870 .addCode(CodeBlock.builder().addStatement("return 0").build()) in interfaceStaticMethods()
891 .addCode(CodeBlock.builder().addStatement("return 0").build()) in interfaceDefaultMethods()
1131 .addStatement("return i") in codeBlocks()
1135 .addStatement("$T size = $T.min(listA.size(), listB.size())", int.class, Math.class) in codeBlocks()
1137 .addStatement("$T $N = $N.get(i)", String.class, "a", "listA") in codeBlocks()
1138 .addStatement("$T $N = $N.get(i)", String.class, "b", "listB") in codeBlocks()
1141 .addStatement("return size") in codeBlocks()
1203 .addStatement("$T.out.println($S)", System.class, "only one taco? NOO!") in indexedElseIf()
1205 .addStatement("$T.out.println($S)", System.class, "taco heaven") in indexedElseIf()
[all …]
/external/javaparser/javaparser-symbol-solver-testing/src/test/test_sourcecode/javaparser_new_src/javaparser-core/com/github/javaparser/ast/nodeTypes/
DNodeWithStatements.java17 public default T addStatement(Statement statement) { in addStatement() method
24 public default T addStatement(int index, final Statement statement) { in addStatement() method
30 public default T addStatement(Expression expr) { in addStatement() method
33 return addStatement(statement); in addStatement()
36 public default T addStatement(String statement) { in addStatement() method
37 return addStatement(new NameExpr(statement)); in addStatement()
40 public default T addStatement(int index, final Expression expr) { in addStatement() method
43 return addStatement(index, stmt); in addStatement()
/external/javaparser/javaparser-core/src/main/java/com/github/javaparser/ast/nodeTypes/
DNodeWithStatements.java53 default N addStatement(Statement statement) { in addStatement() method
59 default N addStatement(int index, final Statement statement) { in addStatement() method
64 default N addStatement(Expression expr) { in addStatement() method
65 return addStatement(new ExpressionStmt(expr)); in addStatement()
71 default N addStatement(String statement) { in addStatement() method
72 return addStatement(parseStatement(statement)); in addStatement()
75 default N addStatement(int index, final Expression expr) { in addStatement() method
77 return addStatement(index, stmt); in addStatement()
106 addStatement(n.clone()); in copyStatements()
/external/javaparser/javaparser-core-generators/src/main/java/com/github/javaparser/generator/core/visitor/
DModifierVisitorGenerator.java30 body.addStatement(f("NodeList<%s> %s = modifyList(n.%s(), arg);", in generateVisitMethodBody()
35 … body.addStatement(f("%s %s = n.%s().map(s -> (%s) s.accept(this, arg)).orElse(null);", in generateVisitMethodBody()
41 body.addStatement(f("%s %s = (%s) n.%s().accept(this, arg);", in generateVisitMethodBody()
51 body.addStatement("if (left == null) return right;"); in generateVisitMethodBody()
52 body.addStatement("if (right == null) return left;"); in generateVisitMethodBody()
67 body.addStatement(collapseCheck.toString()); in generateVisitMethodBody()
73 … body.addStatement(f("n.%s(%s);", property.getSetterMethodName(), property.getName())); in generateVisitMethodBody()
76 body.addStatement("return n;"); in generateVisitMethodBody()
DCloneVisitorGenerator.java33 …body.addStatement(f("NodeList<%s> %s = cloneList(n.%s.orElse(null), arg);", field.getTypeNameGener… in generateVisitMethodBody()
35 …body.addStatement(f("NodeList<%s> %s = cloneList(n.%s, arg);", field.getTypeNameGenerified(), fiel… in generateVisitMethodBody()
37 …body.addStatement(f("%s %s = cloneNode(n.%s, arg);", field.getTypeNameGenerified(), field.getName(… in generateVisitMethodBody()
55 body.addStatement(builder.toString()); in generateVisitMethodBody()
56 body.addStatement("r.setComment(comment);"); in generateVisitMethodBody()
57 body.addStatement("return r;"); in generateVisitMethodBody()
DEqualsVisitorGenerator.java28 body.addStatement(f("final %s n2 = (%s) arg;", node.getTypeName(), node.getTypeName())); in generateVisitMethodBody()
34 … body.addStatement(f("if (!nodesEquals(n.%s, n2.%s)) return false;", getter, getter)); in generateVisitMethodBody()
36 … body.addStatement(f("if (!nodeEquals(n.%s, n2.%s)) return false;", getter, getter)); in generateVisitMethodBody()
39 body.addStatement(f("if (!objEquals(n.%s, n2.%s)) return false;", getter, getter)); in generateVisitMethodBody()
46 body.addStatement("return true;"); in generateVisitMethodBody()
DNoCommentEqualsVisitorGenerator.java53 body.addStatement(f("final %s n2 = (%s) arg;", node.getTypeName(), node.getTypeName())); in generateVisitMethodBody()
61 … body.addStatement(f("if (!nodesEquals(n.%s, n2.%s)) return false;", getter, getter)); in generateVisitMethodBody()
63 … body.addStatement(f("if (!nodeEquals(n.%s, n2.%s)) return false;", getter, getter)); in generateVisitMethodBody()
66 … body.addStatement(f("if (!objEquals(n.%s, n2.%s)) return false;", getter, getter)); in generateVisitMethodBody()
74 body.addStatement("return true;"); in generateVisitMethodBody()
DGenericListVisitorAdapterGenerator.java31 body.addStatement("List<R> result = new ArrayList<>();"); in generateVisitMethodBody()
32 body.addStatement("List<R> tmp;"); in generateVisitMethodBody()
40 body.addStatement(f("if (n.%s.isPresent()) {" + in generateVisitMethodBody()
45 … body.addStatement(f("{ tmp = n.%s.accept(this, arg); %s }", getter, resultCheck)); in generateVisitMethodBody()
49 body.addStatement("return result;"); in generateVisitMethodBody()
DGenericVisitorAdapterGenerator.java28 body.addStatement("R result;"); in generateVisitMethodBody()
36 body.addStatement(f("if (n.%s.isPresent()) {" + in generateVisitMethodBody()
41 … body.addStatement(f("{ result = n.%s.accept(this, arg); %s }", getter, resultCheck)); in generateVisitMethodBody()
45 body.addStatement("return null;"); in generateVisitMethodBody()
DVoidVisitorAdapterGenerator.java32 … body.addStatement(f("n.%s.ifPresent( l -> l.forEach( v -> v.accept(this, arg)));", getter)); in generateVisitMethodBody()
34 body.addStatement(f("n.%s.ifPresent(l -> l.accept(this, arg));", getter)); in generateVisitMethodBody()
36 body.addStatement(f("n.%s.forEach(p -> p.accept(this, arg));", getter)); in generateVisitMethodBody()
38 body.addStatement(f("n.%s.accept(this, arg);", getter)); in generateVisitMethodBody()
/external/javaparser/javaparser-core-generators/src/main/java/com/github/javaparser/generator/core/node/
DPropertyGenerator.java66 body.addStatement(f("assertNonEmpty(%s);", name)); in generateSetter()
68 body.addStatement(f("assertNotNull(%s);", name)); in generateSetter()
71 … body.addStatement(f("if (%s == this.%s) { return (%s) this; }", name, name, setter.getType())); in generateSetter()
73 …body.addStatement(f("notifyPropertyChange(ObservableProperty.%s, this.%s, %s);", observableName, n… in generateSetter()
75 body.addStatement(f("if (this.%s != null) this.%s.setParentNode(null);", name, name)); in generateSetter()
77 body.addStatement(f("this.%s = %s;", name, name)); in generateSetter()
79 body.addStatement(f("setAsParentNodeOf(%s);", name)); in generateSetter()
82 body.addStatement(f("return (T) this;")); in generateSetter()
84 body.addStatement(f("return this;")); in generateSetter()
97 body.addStatement(f("return Optional.ofNullable(%s);", property.getName())); in generateGetter()
[all …]
DRemoveMethodGenerator.java31 body.addStatement("if (node == null) return false;"); in generateNode()
50 body.addStatement(check); in generateNode()
53 body.addStatement("return super.remove(node);"); in generateNode()
55 body.addStatement("return false;"); in generateNode()
82 …block.addStatement(f("return %s((%s) null);", property.getSetterMethodName(), property.getTypeName… in generateRemoveMethodForAttribute()
DReplaceMethodGenerator.java30 body.addStatement("if (node == null) return false;"); in generateNode()
45 body.addStatement(check); in generateNode()
48 body.addStatement("return super.replace(node, replacementNode);"); in generateNode()
50 body.addStatement("return false;"); in generateNode()
DMainConstructorGenerator.java41 … body.addStatement(f("%s(%s);", parameter.getSetterMethodName(), parameter.getName())); in generateNode()
49 body.addStatement("customInitialization();"); in generateNode()
/external/javaparser/javaparser-symbol-solver-testing/src/test/resources/javaparser_methodcalls_expected_output/
Dcom_github_javaparser_ast_nodeTypes_NodeWithStatements.txt8 …Line 33) addStatement(statement) ==> com.github.javaparser.ast.nodeTypes.NodeWithStatements.addSta…
9 …Line 37) addStatement(new NameExpr(statement)) ==> com.github.javaparser.ast.nodeTypes.NodeWithSta…
11 …Line 43) addStatement(index, stmt) ==> com.github.javaparser.ast.nodeTypes.NodeWithStatements.addS…
Dcom_github_javaparser_ast_body_FieldDeclaration.txt43 …ne 212) blockStmt.addStatement(new ReturnStmt(name(fieldName))) ==> com.github.javaparser.ast.node…
65addStatement(new AssignExpr(new NameExpr("this." + fieldName), new NameExpr(fieldName), Operator.a…
/external/javapoet/
DREADME.md32 .addStatement("$T.out.println($S)", System.class, "Hello, JavaPoet!")
87 make it easier. There's `addStatement()` which takes care of semicolons and newline, and
93 .addStatement("int total = 0")
95 .addStatement("total += i")
107 .addStatement("int result = 1")
109 .addStatement("result = result " + op + " i")
111 .addStatement("return result")
134 The string-concatenation in calls to `beginControlFlow()` and `addStatement` is distracting. Too
143 .addStatement("int result = 0")
145 .addStatement("result = result $L i", op)
[all …]
/external/tensorflow/tensorflow/java/src/gen/java/org/tensorflow/processor/
DOperatorProcessor.java268 builder.addStatement(call.toString(), opClassName); in buildOpMethod()
302 .addStatement("this.scope = scope"); in buildGroupClass()
328 .addStatement("this.scope = scope", T_SCOPE); in buildTopClass()
331 ctorBuilder.addStatement("$L = new $T(scope)", entry.getKey(), entry.getValue()); in buildTopClass()
376 .addStatement("return new $T(scope.withSubScope(childScopeName))", T_OPS) in buildTopClass()
388 .addStatement("return new Ops(scope.withName(opName))") in buildTopClass()
402 .addStatement("return scope") in buildTopClass()
416 .addStatement("return $L", entry.getKey()) in buildTopClass()
427 .addStatement("return new Ops(new $T(graph))", T_SCOPE) in buildTopClass()
/external/javaparser/javaparser-testing/src/test/java/com/github/javaparser/ast/stmt/
DBlockStmtTest.java15 blockStmt.addStatement(expression); in issue748AddingIdenticalStatementsDoesParentingRight()
16 blockStmt.addStatement(expression.clone()); in issue748AddingIdenticalStatementsDoesParentingRight()
/external/skqp/src/sksl/
DSkSLCFGGenerator.cpp453 void CFGGenerator::addStatement(CFG& cfg, std::unique_ptr<Statement>* s) { in addStatement() function in SkSL::CFGGenerator
457 addStatement(cfg, &child); in addStatement()
467 this->addStatement(cfg, &ifs.fIfTrue); in addStatement()
472 this->addStatement(cfg, &ifs.fIfFalse); in addStatement()
540 this->addStatement(cfg, &w.fStatement); in addStatement()
553 this->addStatement(cfg, &d.fStatement); in addStatement()
565 this->addStatement(cfg, &f.fInitializer); in addStatement()
583 this->addStatement(cfg, &f.fStatement); in addStatement()
613 this->addStatement(cfg, &caseStatement); in addStatement()
638 this->addStatement(result, &f.fBody); in getCFG()
/external/skia/src/sksl/
DSkSLCFGGenerator.cpp454 void CFGGenerator::addStatement(CFG& cfg, std::unique_ptr<Statement>* s) { in addStatement() function in SkSL::CFGGenerator
458 addStatement(cfg, &child); in addStatement()
468 this->addStatement(cfg, &ifs.fIfTrue); in addStatement()
473 this->addStatement(cfg, &ifs.fIfFalse); in addStatement()
541 this->addStatement(cfg, &w.fStatement); in addStatement()
554 this->addStatement(cfg, &d.fStatement); in addStatement()
566 this->addStatement(cfg, &f.fInitializer); in addStatement()
584 this->addStatement(cfg, &f.fStatement); in addStatement()
614 this->addStatement(cfg, &caseStatement); in addStatement()
639 this->addStatement(result, &f.fBody); in getCFG()
/external/javaparser/javaparser-testing/src/test/java/com/github/javaparser/remove/
DNodeRemovalTest.java65 Statement addStatement = methodBody.addAndGetStatement("test"); in testRemoveStatementFromMethodBody() local
67 boolean remove = addStatement.remove(); in testRemoveStatementFromMethodBody()
/external/javapoet/src/main/java/com/squareup/javapoet/
DCodeBlock.java400 public Builder addStatement(String format, Object... args) {
407 public Builder addStatement(CodeBlock codeBlock) {
408 return addStatement("$L", codeBlock);
DMethodSpec.java479 public Builder addStatement(String format, Object... args) { in addStatement() method in MethodSpec.Builder
480 code.addStatement(format, args); in addStatement()
484 public Builder addStatement(CodeBlock codeBlock) { in addStatement() method in MethodSpec.Builder
485 code.addStatement(codeBlock); in addStatement()

12