All Packages Class Hierarchy This Package Previous Next Index
Class classinfo.Classfile
java.lang.Object
|
+----classinfo.Classfile
- public class Classfile
- extends Object
Representation of a class file.
-
Classfile(DataInputStream)
- Reads a class file from in and constructs an instance of this class.
-
attribute(int)
- get an attribute element.
-
attributeCount()
- get attributes count of this class.
-
constant(int)
- get Constant Pool element.
-
constantPoolCount()
- get Constant Pool count.
-
field(int)
- get a field elemnt.
-
fieldCount()
- get field count of this class.
-
getInterface(int)
- get a Constant Pool element rpresents an interface.
-
insertConstantAt(ConstantInPool, int)
- Inserts the specified constant at the specified index.
-
interfaceCount()
- get interface count of this class.
-
list(PrintStream)
- Write this class as text into a print stream, out.
-
main(String[])
- Reads the classfile given as arguments
and writes as text to standard output.
-
method(int)
- get a method element.
-
methodCount()
- get method count of this class.
-
removeConstantAt(int)
- Removes the constant at the specified index.
-
setConstantAt(ConstantInPool, int)
- Replaces the constant at the specified index with the specified constant.
-
superClass()
- get Constant Pool element represents superclass.
-
thisClass()
- get Constant Pool element represents this class.
-
write(DataOutputStream)
- Writes this class as class file into a data output stream, out.
Classfile
public Classfile(DataInputStream in) throws IOException, ClassFormatError
- Reads a class file from in and constructs an instance of this class.
write
public void write(DataOutputStream out) throws IOException
- Writes this class as class file into a data output stream, out.
- Parameters:
- out - a data output stream
list
public void list(PrintStream out)
- Write this class as text into a print stream, out.
- Parameters:
- out - a print stream
constantPoolCount
public int constantPoolCount()
- get Constant Pool count.
constant
public ConstantInPool constant(int index)
- get Constant Pool element.
thisClass
public ConstantInPool thisClass()
- get Constant Pool element represents this class.
superClass
public ConstantInPool superClass()
- get Constant Pool element represents superclass.
interfaceCount
public int interfaceCount()
- get interface count of this class.
getInterface
public ConstantInPool getInterface(int index)
- get a Constant Pool element rpresents an interface.
fieldCount
public int fieldCount()
- get field count of this class.
field
public Field field(int index)
- get a field elemnt.
methodCount
public int methodCount()
- get method count of this class.
method
public Method method(int index)
- get a method element.
attributeCount
public int attributeCount()
- get attributes count of this class.
attribute
public Attribute attribute(int index)
- get an attribute element.
setConstantAt
public void setConstantAt(ConstantInPool constant,
int index)
- Replaces the constant at the specified index with the specified constant.
insertConstantAt
public void insertConstantAt(ConstantInPool constant,
int index)
- Inserts the specified constant at the specified index.
removeConstantAt
public int[] removeConstantAt(int index)
- Removes the constant at the specified index.
- Returns:
- an array of indices of constants
which refer to the removed constant.
main
public static void main(String argv[]) throws IOException
- Reads the classfile given as arguments
and writes as text to standard output.
All Packages Class Hierarchy This Package Previous Next Index