public final class ConstantMethodTypeInfo extends CPInfo
ConstantMethodTypeInfo
denotes a CONSTANT_MethodType_info structure in the constant_pool of a ClassFile structure.
The CONSTANT_MethodType_info structure was added to Java in version 7.
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the CONSTANT_MethodType_info structure.
|
static int |
TAG
The tag for CONSTANT_MethodType.
|
Modifier and Type | Method and Description |
---|---|
ConstantMethodTypeInfo |
copy()
Returns a copy of this
ConstantMethodTypeInfo instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of ConstantMethodTypeInfo , and that ConstantMethodTypeInfo instance is equal to this ConstantMethodTypeInfo instance,
false otherwise. |
static java.util.List<ConstantMethodTypeInfo> |
filter(Node node)
Returns a
List with all ConstantMethodTypeInfo s. |
int |
getDescriptorIndex()
Returns the descriptor_index of this
ConstantMethodTypeInfo instance. |
int |
hashCode()
Returns a hash code for this
ConstantMethodTypeInfo instance. |
static ConstantMethodTypeInfo |
newInstance(int descriptorIndex)
Returns a new
ConstantMethodTypeInfo . |
void |
setDescriptorIndex(int descriptorIndex)
Sets a new descriptor_index for this
ConstantMethodTypeInfo instance. |
java.lang.String |
toString()
Returns a
String representation of this ConstantMethodTypeInfo instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
ConstantMethodTypeInfo to dataOutput . |
void |
write(Document document)
Writes this
ConstantMethodTypeInfo to document . |
getConstantPoolEntryCount, getName, getTag
public static final java.lang.String NAME
public static final int TAG
public ConstantMethodTypeInfo copy()
ConstantMethodTypeInfo
instance.public java.lang.String toString()
String
representation of this ConstantMethodTypeInfo
instance.toString
in class java.lang.Object
String
representation of this ConstantMethodTypeInfo
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of ConstantMethodTypeInfo
, and that ConstantMethodTypeInfo
instance is equal to this ConstantMethodTypeInfo
instance,
false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this ConstantMethodTypeInfo
instance for equalitytrue
if, and only if, object
is an instance of ConstantMethodTypeInfo
, and that ConstantMethodTypeInfo
instance is equal to this ConstantMethodTypeInfo
instance,
false
otherwisepublic int getDescriptorIndex()
ConstantMethodTypeInfo
instance.ConstantMethodTypeInfo
instancepublic int hashCode()
ConstantMethodTypeInfo
instance.hashCode
in class java.lang.Object
ConstantMethodTypeInfo
instancepublic void setDescriptorIndex(int descriptorIndex)
ConstantMethodTypeInfo
instance.
If descriptorIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
descriptorIndex
- the new descriptor_index for this ConstantMethodTypeInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, descriptorIndex
is less than or equal to 0
public void write(java.io.DataOutput dataOutput)
ConstantMethodTypeInfo
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)
ConstantMethodTypeInfo
to document
.
If document
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
public static ConstantMethodTypeInfo newInstance(int descriptorIndex)
ConstantMethodTypeInfo
.
If descriptorIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
descriptorIndex
- the descriptor_index of the new ConstantMethodTypeInfo
instanceConstantMethodTypeInfo
java.lang.IllegalArgumentException
- thrown if, and only if, descriptorIndex
is less than or equal to 0
public static java.util.List<ConstantMethodTypeInfo> filter(Node node)
List
with all ConstantMethodTypeInfo
s.
All ConstantMethodTypeInfo
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 ConstantMethodTypeInfo
sjava.lang.NullPointerException
- thrown if, and only if, node
is null