FileDocCategorySizeDatePackage
PMGClass.javaAPI DocJava SE 6 API6492Tue Jun 10 00:22:18 BST 2008com.sun.org.apache.bcel.internal.classfile

PMGClass

public final class PMGClass extends Attribute
This class is derived from Attribute and represents a reference to a PMG attribute.
version
$Id: PMGClass.java,v 1.1.2.1 2005/07/31 23:46:37 jeffsuttor Exp $
author
M. Dahm
see
Attribute

Fields Summary
private int
pmg_class_index
private int
pmg_index
Constructors Summary
public PMGClass(PMGClass c)
Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

    this(c.getNameIndex(), c.getLength(), c.getPMGIndex(), c.getPMGClassIndex(),
	 c.getConstantPool());
  
PMGClass(int name_index, int length, DataInputStream file, ConstantPool constant_pool)
Construct object from file stream.

param
name_index Index in constant pool to CONSTANT_Utf8
param
length Content length in bytes
param
file Input stream
param
constant_pool Array of constants
throws
IOException

    this(name_index, length, file.readUnsignedShort(), file.readUnsignedShort(),
	 constant_pool);
  
public PMGClass(int name_index, int length, int pmg_index, int pmg_class_index, ConstantPool constant_pool)

param
name_index Index in constant pool to CONSTANT_Utf8
param
length Content length in bytes
param
constant_pool Array of constants
param
PMGClass_index Index in constant pool to CONSTANT_Utf8

    super(Constants.ATTR_PMG, name_index, length, constant_pool);
    this.pmg_index       = pmg_index;
    this.pmg_class_index = pmg_class_index;
  
Methods Summary
public voidaccept(com.sun.org.apache.bcel.internal.classfile.Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

param
v Visitor object

     System.err.println("Visiting non-standard PMGClass object");
   
public com.sun.org.apache.bcel.internal.classfile.Attributecopy(com.sun.org.apache.bcel.internal.classfile.ConstantPool constant_pool)

return
deep copy of this attribute

    return (PMGClass)clone();
  
public final voiddump(java.io.DataOutputStream file)
Dump source file attribute to file stream in binary format.

param
file Output file stream
throws
IOException

    super.dump(file);
    file.writeShort(pmg_index);
    file.writeShort(pmg_class_index);
  
public final intgetPMGClassIndex()

return
Index in constant pool of source file name.

 return pmg_class_index; 
public final java.lang.StringgetPMGClassName()

return
PMG class name.

    ConstantUtf8 c = (ConstantUtf8)constant_pool.getConstant(pmg_class_index, 
							     Constants.CONSTANT_Utf8);
    return c.getBytes();
  
public final intgetPMGIndex()

return
Index in constant pool of source file name.

 return pmg_index; 
public final java.lang.StringgetPMGName()

return
PMG name.

    ConstantUtf8 c = (ConstantUtf8)constant_pool.getConstant(pmg_index, 
							     Constants.CONSTANT_Utf8);
    return c.getBytes();
  
public final voidsetPMGClassIndex(int pmg_class_index)

param
PMGClass_index.

    this.pmg_class_index = pmg_class_index;
  
public final voidsetPMGIndex(int pmg_index)

param
PMGClass_index.

    this.pmg_index = pmg_index;
  
public final java.lang.StringtoString()

return
String representation

    return "PMGClass(" + getPMGName() + ", " + getPMGClassName() + ")";