com.jasml.compiler
Class ConstantPoolGenerator

java.lang.Object
  extended bycom.jasml.compiler.ConstantPoolGenerator

public class ConstantPoolGenerator
extends java.lang.Object


Field Summary
private  java.util.HashMap classes
           
private  int count
           
private  ConstantPoolItem[] items
           
private  java.util.HashMap mifRef
           
private  java.util.HashMap nameTypes
           
private  java.util.HashMap strings
           
 
Constructor Summary
ConstantPoolGenerator()
           
 
Method Summary
 int addClass(java.lang.String className)
          this can be used to add a Constant_Class entry into constant pool.
 int addDouble(double var)
           
private  int addFieldNameAndType(java.lang.String name, java.lang.String type)
           
 int addFieldref(java.lang.String name, java.lang.String className, java.lang.String type)
           
 int addFloat(float var)
           
 int addInteger(int var)
           
 int addInterfaceMethodref(java.lang.String name, java.lang.String interfaceName, java.lang.String retType, java.lang.String paras)
           
 int addLong(long var)
           
private  int addMethodNameAndType(java.lang.String name, java.lang.String retType, java.lang.String paras)
           
 int addMethodref(java.lang.String name, java.lang.String className, java.lang.String retType, java.lang.String paras)
           
 int addString(java.lang.String s)
           
 int addUtf8(java.lang.String s)
           
private  void ensureCapacity()
           
 ConstantPool getConstantPool()
           
private  int lookupClass(java.lang.String className)
           
private  int lookupDouble(double var)
           
private  int lookupFloat(float var)
           
private  int lookupInt(int var)
           
private  int lookupLong(long var)
           
private  int lookupMIFref(java.lang.String s)
           
private  int lookupNameAndType(java.lang.String nameType)
           
private  int lookupString(java.lang.String s)
           
private  int lookupUtf8(java.lang.String s)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

private ConstantPoolItem[] items

count

private int count

classes

private java.util.HashMap classes

nameTypes

private java.util.HashMap nameTypes

mifRef

private java.util.HashMap mifRef

strings

private java.util.HashMap strings
Constructor Detail

ConstantPoolGenerator

public ConstantPoolGenerator()
Method Detail

getConstantPool

public ConstantPool getConstantPool()

addClass

public int addClass(java.lang.String className)
this can be used to add a Constant_Class entry into constant pool. a constant class could be of a class type( like java/lang/Object), or of an array type of class(like [Ljava/lang/Object;), or array type of a primitive type(like [[I)

Parameters:
className - can be Strings like java.lang.Object, java.lang.Object[][], int[][].
Returns:

addDouble

public int addDouble(double var)

addFieldref

public int addFieldref(java.lang.String name,
                       java.lang.String className,
                       java.lang.String type)

addFloat

public int addFloat(float var)

addInteger

public int addInteger(int var)

addInterfaceMethodref

public int addInterfaceMethodref(java.lang.String name,
                                 java.lang.String interfaceName,
                                 java.lang.String retType,
                                 java.lang.String paras)

addLong

public int addLong(long var)

addMethodref

public int addMethodref(java.lang.String name,
                        java.lang.String className,
                        java.lang.String retType,
                        java.lang.String paras)

lookupMIFref

private int lookupMIFref(java.lang.String s)

addFieldNameAndType

private int addFieldNameAndType(java.lang.String name,
                                java.lang.String type)

addMethodNameAndType

private int addMethodNameAndType(java.lang.String name,
                                 java.lang.String retType,
                                 java.lang.String paras)

addString

public int addString(java.lang.String s)

lookupString

private int lookupString(java.lang.String s)

addUtf8

public int addUtf8(java.lang.String s)

lookupUtf8

private int lookupUtf8(java.lang.String s)

lookupClass

private int lookupClass(java.lang.String className)

lookupNameAndType

private int lookupNameAndType(java.lang.String nameType)

lookupDouble

private int lookupDouble(double var)

lookupInt

private int lookupInt(int var)

lookupFloat

private int lookupFloat(float var)

lookupLong

private int lookupLong(long var)

ensureCapacity

private void ensureCapacity()

main

public static void main(java.lang.String[] args)