19 * limitations under the License. |
19 * limitations under the License. |
20 */ |
20 */ |
21 |
21 |
22 package com.sun.org.apache.bcel.internal.generic; |
22 package com.sun.org.apache.bcel.internal.generic; |
23 |
23 |
24 |
|
25 /** |
24 /** |
26 * IF_ICMPEQ - Branch if int comparison succeeds |
25 * IF_ICMPEQ - Branch if int comparison succeeds |
27 * |
26 * |
28 * <PRE>Stack: ..., value1, value2 -> ...</PRE> |
27 * <PRE>Stack: ..., value1, value2 -> ...</PRE> |
29 * |
28 * |
30 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> |
29 * @version $Id: IF_ICMPEQ.java 1747278 2016-06-07 17:28:43Z britter $ |
31 */ |
30 */ |
32 public class IF_ICMPEQ extends IfInstruction { |
31 public class IF_ICMPEQ extends IfInstruction { |
33 /** |
|
34 * Empty constructor needed for the Class.newInstance() statement in |
|
35 * Instruction.readInstruction(). Not to be used otherwise. |
|
36 */ |
|
37 IF_ICMPEQ() {} |
|
38 |
32 |
39 public IF_ICMPEQ(InstructionHandle target) { |
33 /** |
40 super(com.sun.org.apache.bcel.internal.Constants.IF_ICMPEQ, target); |
34 * Empty constructor needed for the Class.newInstance() statement in |
41 } |
35 * Instruction.readInstruction(). Not to be used otherwise. |
42 |
36 */ |
43 /** |
37 IF_ICMPEQ() { |
44 * @return negation of instruction |
38 } |
45 */ |
|
46 public IfInstruction negate() { |
|
47 return new IF_ICMPNE(target); |
|
48 } |
|
49 |
39 |
50 |
40 |
51 /** |
41 public IF_ICMPEQ(final InstructionHandle target) { |
52 * Call corresponding visitor method(s). The order is: |
42 super(com.sun.org.apache.bcel.internal.Const.IF_ICMPEQ, target); |
53 * Call visitor methods of implemented interfaces first, then |
43 } |
54 * call methods according to the class hierarchy in descending order, |
44 |
55 * i.e., the most specific visitXXX() call comes last. |
45 |
56 * |
46 /** |
57 * @param v Visitor object |
47 * @return negation of instruction |
58 */ |
48 */ |
59 public void accept(Visitor v) { |
49 @Override |
60 v.visitStackConsumer(this); |
50 public IfInstruction negate() { |
61 v.visitBranchInstruction(this); |
51 return new IF_ICMPNE(super.getTarget()); |
62 v.visitIfInstruction(this); |
52 } |
63 v.visitIF_ICMPEQ(this); |
53 |
64 } |
54 |
|
55 /** |
|
56 * Call corresponding visitor method(s). The order is: |
|
57 * Call visitor methods of implemented interfaces first, then |
|
58 * call methods according to the class hierarchy in descending order, |
|
59 * i.e., the most specific visitXXX() call comes last. |
|
60 * |
|
61 * @param v Visitor object |
|
62 */ |
|
63 @Override |
|
64 public void accept( final Visitor v ) { |
|
65 v.visitStackConsumer(this); |
|
66 v.visitBranchInstruction(this); |
|
67 v.visitIfInstruction(this); |
|
68 v.visitIF_ICMPEQ(this); |
|
69 } |
65 } |
70 } |