|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wisc.cs.java.Accessible | +--edu.wisc.cs.java.MethodInfo
This object maintains a Method_Info table, as specified by the Java Virtual Machine specification for class files.
Field Summary | |
protected java.util.Vector |
attributes
An array of sttributes for this method. |
protected int |
code_index
The index into the attributes array containing the code
attribute for this method. |
protected ConstantPool |
cpool
The constant pool to which this MethodInfo refers. |
protected int |
descriptor_index
The index in the constant pool of the descriptor (type) of this method. |
protected int |
name_index
The index in the constant pool of the name of this method. |
Fields inherited from class edu.wisc.cs.java.Accessible |
ACC_ABSTRACT,
ACC_FINAL,
ACC_INTERFACE,
ACC_NATIVE,
ACC_PRIVATE,
ACC_PROTECTED,
ACC_PUBLIC,
ACC_STATIC,
ACC_SUPER,
ACC_SYNCHRONIZED,
ACC_TRANSIENT,
ACC_VOLATILE,
access_flags |
Constructor Summary | |
MethodInfo(ClassFile cls,
int flags,
java.lang.String name,
java.lang.String desc)
Creates a new method for a class class with the specified access flags, name and descriptor. |
|
MethodInfo(java.io.DataInputStream in,
ConstantPool cp)
Constructs a MethodInfo object reading data from the given stream, and and refering to the given constant pool. |
Method Summary | |
CodeAttribute |
getCode()
Returns the code attribute for this method. |
java.lang.String |
getDescriptor()
Returns a string containing the descriptor of this method. |
int |
getDescriptorIndex()
Returns the index of the descriptor of this method in the constant pool. |
java.lang.String |
getName()
Returns a string containing the name of this method. |
int |
getNameIndex()
Returns the index of the name of this method in the constant pool. |
void |
printData(java.io.PrintStream out)
Prints information about this method to the specified stream. |
void |
writeTo(java.io.DataOutputStream out)
Writes a method to the specified stream. |
Methods inherited from class edu.wisc.cs.java.Accessible |
getFlag,
setFlag,
unSetFlag |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected ConstantPool cpool
protected int name_index
protected int descriptor_index
protected java.util.Vector attributes
protected int code_index
attributes
array containing the code
attribute for this method.Constructor Detail |
public MethodInfo(ClassFile cls, int flags, java.lang.String name, java.lang.String desc)
cls
- the class to which the new method will belong.flags
- the access flags for the new method.name
- the name of the new method.desc
- the descriptor of the new method.public MethodInfo(java.io.DataInputStream in, ConstantPool cp) throws java.io.IOException
in
- a stream from which to read the data for this method.Method Detail |
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
out
- the destination stream to write data to.public CodeAttribute getCode()
public java.lang.String getName()
public java.lang.String getDescriptor()
public int getNameIndex()
public int getDescriptorIndex()
public void printData(java.io.PrintStream out)
out
- the stream to which to print the data.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |