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.


Constructor Index

 o Classfile(DataInputStream)
Reads a class file from in and constructs an instance of this class.

Method Index

 o attribute(int)
get an attribute element.
 o attributeCount()
get attributes count of this class.
 o constant(int)
get Constant Pool element.
 o constantPoolCount()
get Constant Pool count.
 o field(int)
get a field elemnt.
 o fieldCount()
get field count of this class.
 o getInterface(int)
get a Constant Pool element rpresents an interface.
 o insertConstantAt(ConstantInPool, int)
Inserts the specified constant at the specified index.
 o interfaceCount()
get interface count of this class.
 o list(PrintStream)
Write this class as text into a print stream, out.
 o main(String[])
Reads the classfile given as arguments and writes as text to standard output.
 o method(int)
get a method element.
 o methodCount()
get method count of this class.
 o removeConstantAt(int)
Removes the constant at the specified index.
 o setConstantAt(ConstantInPool, int)
Replaces the constant at the specified index with the specified constant.
 o superClass()
get Constant Pool element represents superclass.
 o thisClass()
get Constant Pool element represents this class.
 o write(DataOutputStream)
Writes this class as class file into a data output stream, out.

Constructors

 o Classfile
 public Classfile(DataInputStream in) throws IOException, ClassFormatError
Reads a class file from in and constructs an instance of this class.

Methods

 o 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
 o list
 public void list(PrintStream out)
Write this class as text into a print stream, out.

Parameters:
out - a print stream
 o constantPoolCount
 public int constantPoolCount()
get Constant Pool count.

 o constant
 public ConstantInPool constant(int index)
get Constant Pool element.

 o thisClass
 public ConstantInPool thisClass()
get Constant Pool element represents this class.

 o superClass
 public ConstantInPool superClass()
get Constant Pool element represents superclass.

 o interfaceCount
 public int interfaceCount()
get interface count of this class.

 o getInterface
 public ConstantInPool getInterface(int index)
get a Constant Pool element rpresents an interface.

 o fieldCount
 public int fieldCount()
get field count of this class.

 o field
 public Field field(int index)
get a field elemnt.

 o methodCount
 public int methodCount()
get method count of this class.

 o method
 public Method method(int index)
get a method element.

 o attributeCount
 public int attributeCount()
get attributes count of this class.

 o attribute
 public Attribute attribute(int index)
get an attribute element.

 o setConstantAt
 public void setConstantAt(ConstantInPool constant,
                           int index)
Replaces the constant at the specified index with the specified constant.

 o insertConstantAt
 public void insertConstantAt(ConstantInPool constant,
                              int index)
Inserts the specified constant at the specified index.

 o 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.
 o 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