public final class ConstantInterfaceMethodRefInfo extends CPInfo
ConstantInterfaceMethodRefInfo
denotes a CONSTANT_InterfaceMethodref_info structure in the constant_pool of a ClassFile structure.
The CONSTANT_InterfaceMethodref_info structure was added to Java in version 1.0.2.
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the CONSTANT_InterfaceMethodref_info structure.
|
static int |
TAG
The tag for CONSTANT_InterfaceMethodref.
|
Modifier and Type | Method and Description |
---|---|
ConstantInterfaceMethodRefInfo |
copy()
Returns a copy of this
ConstantInterfaceMethodRefInfo instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of ConstantInterfaceMethodRefInfo , and that ConstantInterfaceMethodRefInfo instance is equal to this
ConstantInterfaceMethodRefInfo instance, false otherwise. |
static java.util.List<ConstantInterfaceMethodRefInfo> |
filter(Node node)
Returns a
List with all ConstantInterfaceMethodRefInfo s. |
int |
getClassIndex()
Returns the class_index of this
ConstantInterfaceMethodRefInfo instance. |
int |
getNameAndTypeIndex()
Returns the name_and_type_index of this
ConstantInterfaceMethodRefInfo instance. |
int |
hashCode()
Returns a hash code for this
ConstantInterfaceMethodRefInfo instance. |
static ConstantInterfaceMethodRefInfo |
newInstance(int classIndex,
int nameAndTypeIndex)
Returns a new
ConstantInterfaceMethodRefInfo . |
void |
setClassIndex(int classIndex)
Sets a new class_index for this
ConstantInterfaceMethodRefInfo instance. |
void |
setNameAndTypeIndex(int nameAndTypeIndex)
Sets a new name_and_type_index for this
ConstantInterfaceMethodRefInfo instance. |
java.lang.String |
toString()
Returns a
String representation of this ConstantInterfaceMethodRefInfo instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
ConstantInterfaceMethodRefInfo to dataOutput . |
void |
write(Document document)
Writes this
ConstantInterfaceMethodRefInfo to document . |
getConstantPoolEntryCount, getName, getTag
public static final java.lang.String NAME
public static final int TAG
public ConstantInterfaceMethodRefInfo copy()
ConstantInterfaceMethodRefInfo
instance.public java.lang.String toString()
String
representation of this ConstantInterfaceMethodRefInfo
instance.toString
in class java.lang.Object
String
representation of this ConstantInterfaceMethodRefInfo
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of ConstantInterfaceMethodRefInfo
, and that ConstantInterfaceMethodRefInfo
instance is equal to this
ConstantInterfaceMethodRefInfo
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this ConstantInterfaceMethodRefInfo
instance for equalitytrue
if, and only if, object
is an instance of ConstantInterfaceMethodRefInfo
, and that ConstantInterfaceMethodRefInfo
instance is equal to this
ConstantInterfaceMethodRefInfo
instance, false
otherwisepublic int getClassIndex()
ConstantInterfaceMethodRefInfo
instance.ConstantInterfaceMethodRefInfo
instancepublic int getNameAndTypeIndex()
ConstantInterfaceMethodRefInfo
instance.ConstantInterfaceMethodRefInfo
instancepublic int hashCode()
ConstantInterfaceMethodRefInfo
instance.hashCode
in class java.lang.Object
ConstantInterfaceMethodRefInfo
instancepublic void setClassIndex(int classIndex)
ConstantInterfaceMethodRefInfo
instance.
If classIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
classIndex
- the new class_index for this ConstantInterfaceMethodRefInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, classIndex
is less than or equal to 0
public void setNameAndTypeIndex(int nameAndTypeIndex)
ConstantInterfaceMethodRefInfo
instance.
If nameAndTypeIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
nameAndTypeIndex
- the new name_and_type_index for this ConstantInterfaceMethodRefInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, nameAndTypeIndex
is less than or equal to 0
public void write(java.io.DataOutput dataOutput)
ConstantInterfaceMethodRefInfo
to dataOutput
.
If dataOutput
is an OutputStream
(or any other type of stream), this method will not close it.
If dataOutput
is null
, a NullPointerException
will be thrown.
If an I/O-error occurs, an UncheckedIOException
will be thrown.
public void write(Document document)
ConstantInterfaceMethodRefInfo
to document
.
If document
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
public static ConstantInterfaceMethodRefInfo newInstance(int classIndex, int nameAndTypeIndex)
ConstantInterfaceMethodRefInfo
.
If either classIndex
or nameAndTypeIndex
are less than or equal to 0
, an IllegalArgumentException
will be thrown.
classIndex
- the class_index for the new ConstantInterfaceMethodRefInfo
instancenameAndTypeIndex
- the name_and_type_index for the new ConstantInterfaceMethodRefInfo
instanceConstantInterfaceMethodRefInfo
java.lang.IllegalArgumentException
- thrown if, and only if, either classIndex
or nameAndTypeIndex
are less than or equal to 0
public static java.util.List<ConstantInterfaceMethodRefInfo> filter(Node node)
List
with all ConstantInterfaceMethodRefInfo
s.
All ConstantInterfaceMethodRefInfo
s are found by traversing node
using a simple NodeHierarchicalVisitor
implementation.
If node
is null
, a NullPointerException
will be thrown.
node
- the Node
to start traversal fromList
with all ConstantInterfaceMethodRefInfo
sjava.lang.NullPointerException
- thrown if, and only if, node
is null