
opu.lljvm-clang.0.2.0-EXPERIMENTAL.source-code.ClassEnv Maven / Gradle / Ivy
The newest version!
package jas;
import java.io.*;
import java.util.Hashtable;
import java.util.Enumeration;
import java.util.Vector;
/**
* This is the place where all information about the class to
* be created resides.
*
* @author $Author: jonmeyerny $
* @version $Revision: 1.1 $
*/
public class ClassEnv implements RuntimeConstants
{
int magic;
short version_lo, version_hi;
CP this_class, super_class;
short class_access;
Hashtable cpe, cpe_index;
Vector interfaces;
Vector vars;
Vector methods;
SourceAttr source;
SignatureAttr signature;
SourceDebugExtensionAttr debug;
EnclosingMethodAttr enclosing;
DeprecatedAttr depr;
InnerClassesAttr innerclasses;
AnnotationAttr annVis, annInvis;
Vector generic;
public ClassEnv()
{
// Fill in reasonable defaults
magic = JAVA_MAGIC;
version_lo = (short) JAVA_MINOR_VERSION;
version_hi = (short) JAVA_VERSION;
// Initialize bags
cpe = new Hashtable();
cpe_index = null;
interfaces = new Vector();
vars = new Vector();
methods = new Vector();
annVis = annInvis = null;
generic = new Vector();
}
/**
* Define this class to have this name.
* @param name CPE representing name for class. (This is usually
* a ClassCP)
*/
public void setClass(CP name)
{ this_class = name; addCPItem(name); }
/**
* Define this class to have this superclass
* @param name CPE representing name for class. (This is usually
* a ClassCP)
*/
public void setSuperClass(CP name)
{ super_class = name; addCPItem(name); }
/**
* Set the class access for this class. Constants understood
* by this are present along with the java Beta distribution.
* @param access number representing access permissions for
* the entire class.
* @see RuntimeConstants
*/
public void setClassAccess(short access)
{ class_access = access; }
/**
* Add this CP to the list of interfaces supposedly implemented by
* this class. Note that the CP ought to be a ClassCP to make
* sense to the VM.
*/
public void addInterface(CP ifc)
{
addCPItem(ifc);
interfaces.addElement(ifc);
}
/**
* Add this to the list of interfaces supposedly implemented
* by this class. Note that each CP is usually a ClassCP.
* @param ilist An array of CP items representing the
* interfaces implemented by this class.
*/
public void addInterface(CP ilist[])
{
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy