19 * limitations under the License. |
19 * limitations under the License. |
20 */ |
20 */ |
21 |
21 |
22 package com.sun.org.apache.bcel.internal.classfile; |
22 package com.sun.org.apache.bcel.internal.classfile; |
23 |
23 |
|
24 import java.io.DataInput; |
|
25 import java.io.IOException; |
24 |
26 |
25 import com.sun.org.apache.bcel.internal.Constants; |
27 import com.sun.org.apache.bcel.internal.Const; |
26 import java.io.*; |
|
27 |
28 |
28 /** |
29 /** |
29 * This class represents a constant pool reference to an interface method. |
30 * This class represents a constant pool reference to an interface method. |
30 * |
31 * |
31 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> |
32 * @version $Id: ConstantInterfaceMethodref.java 1747278 2016-06-07 17:28:43Z britter $ |
32 */ |
33 */ |
33 public final class ConstantInterfaceMethodref extends ConstantCP { |
34 public final class ConstantInterfaceMethodref extends ConstantCP { |
34 /** |
|
35 * Initialize from another object. |
|
36 */ |
|
37 public ConstantInterfaceMethodref(ConstantInterfaceMethodref c) { |
|
38 super(Constants.CONSTANT_InterfaceMethodref, c.getClassIndex(), c.getNameAndTypeIndex()); |
|
39 } |
|
40 |
35 |
41 /** |
36 /** |
42 * Initialize instance from file data. |
37 * Initialize from another object. |
43 * |
38 */ |
44 * @param file input stream |
39 public ConstantInterfaceMethodref(final ConstantInterfaceMethodref c) { |
45 * @throws IOException |
40 super(Const.CONSTANT_InterfaceMethodref, c.getClassIndex(), c.getNameAndTypeIndex()); |
46 */ |
41 } |
47 ConstantInterfaceMethodref(DataInputStream file) throws IOException |
|
48 { |
|
49 super(Constants.CONSTANT_InterfaceMethodref, file); |
|
50 } |
|
51 |
42 |
52 /** |
|
53 * @param class_index Reference to the class containing the method |
|
54 * @param name_and_type_index and the method signature |
|
55 */ |
|
56 public ConstantInterfaceMethodref(int class_index, |
|
57 int name_and_type_index) { |
|
58 super(Constants.CONSTANT_InterfaceMethodref, class_index, name_and_type_index); |
|
59 } |
|
60 |
43 |
61 /** |
44 /** |
62 * Called by objects that are traversing the nodes of the tree implicitely |
45 * Initialize instance from input data. |
63 * defined by the contents of a Java class. I.e., the hierarchy of methods, |
46 * |
64 * fields, attributes, etc. spawns a tree of objects. |
47 * @param input input stream |
65 * |
48 * @throws IOException |
66 * @param v Visitor object |
49 */ |
67 */ |
50 ConstantInterfaceMethodref(final DataInput input) throws IOException { |
68 public void accept(Visitor v) { |
51 super(Const.CONSTANT_InterfaceMethodref, input); |
69 v.visitConstantInterfaceMethodref(this); |
52 } |
70 } |
53 |
|
54 |
|
55 /** |
|
56 * @param class_index Reference to the class containing the method |
|
57 * @param name_and_type_index and the method signature |
|
58 */ |
|
59 public ConstantInterfaceMethodref(final int class_index, final int name_and_type_index) { |
|
60 super(Const.CONSTANT_InterfaceMethodref, class_index, name_and_type_index); |
|
61 } |
|
62 |
|
63 |
|
64 /** |
|
65 * Called by objects that are traversing the nodes of the tree implicitely |
|
66 * defined by the contents of a Java class. I.e., the hierarchy of methods, |
|
67 * fields, attributes, etc. spawns a tree of objects. |
|
68 * |
|
69 * @param v Visitor object |
|
70 */ |
|
71 @Override |
|
72 public void accept( final Visitor v ) { |
|
73 v.visitConstantInterfaceMethodref(this); |
|
74 } |
71 } |
75 } |