MCPcopy Index your code
hub / github.com/airlift/bytecode / ForLoop

Class ForLoop

src/main/java/io/airlift/bytecode/control/ForLoop.java:28–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26import static com.google.common.base.Preconditions.checkState;
27
28public class ForLoop
29 implements FlowControl
30{
31 private final String comment;
32 private final BytecodeBlock initialize = new BytecodeBlock();
33 private final BytecodeBlock condition = new BytecodeBlock();
34 private final BytecodeBlock update = new BytecodeBlock();
35 private final BytecodeBlock body = new BytecodeBlock();
36
37 private final LabelNode beginLabel = new LabelNode("beginLabel");
38 private final LabelNode continueLabel = new LabelNode("continue");
39 private final LabelNode endLabel = new LabelNode("end");
40
41 public ForLoop()
42 {
43 this.comment = null;
44 }
45
46 public ForLoop(String format, Object... args)
47 {
48 this.comment = String.format(format, args);
49 }
50
51 @Override
52 public String getComment()
53 {
54 return comment;
55 }
56
57 public LabelNode getContinueLabel()
58 {
59 return continueLabel;
60 }
61
62 public LabelNode getEndLabel()
63 {
64 return endLabel;
65 }
66
67 public BytecodeBlock initialize()
68 {
69 return initialize;
70 }
71
72 public ForLoop initialize(BytecodeNode node)
73 {
74 checkState(initialize.isEmpty(), "initialize already set");
75 initialize.append(node);
76 return this;
77 }
78
79 public BytecodeBlock condition()
80 {
81 return condition;
82 }
83
84 public ForLoop condition(BytecodeNode node)
85 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected