futils.utils
Class ConstantPoolInfo

java.lang.Object
  |
  +--futils.utils.ConstantPoolInfo

public class ConstantPoolInfo
extends java.lang.Object

This class defines an entry in the constant pool for a Java class. The class file is primarily composed of ConstantPool entries and manipulation is done by modifying those entries.

Version:
1.5, 16 Aug 1995
Author:
Chuck McManis
See Also:
ClassFile

Field Summary
static int ASCIZ
           
static int CLASS
           
static int DOUBLE
           
static int FIELDREF
           
static int FLOAT
           
static int INTEGER
           
static int INTERFACE
           
static int LONG
           
static int METHODREF
           
static int NAMEANDTYPE
           
static int STRING
           
static int UNICODE
           
 
Constructor Summary
ConstantPoolInfo()
          Generic constructor
ConstantPoolInfo(double value)
          Construct a new ConstantPoolInfo object that is of type DOUBLE
ConstantPoolInfo(float value)
          Construct a new ConstantPoolInfo object that is of type FLOAT
ConstantPoolInfo(int value)
          Construct a new ConstantPoolInfo object that is of type INTEGER
ConstantPoolInfo(long value)
          Construct a new ConstantPoolInfo object that is of type LONG
ConstantPoolInfo(java.lang.String value)
          Construct a new ConstantPoolInfo object that is of type ASCIZ
 
Method Summary
static short indexOf(ConstantPoolInfo item, ConstantPoolInfo[] pool)
           
 ConstantPoolInfo inPool(ConstantPoolInfo[] pool)
          Returns the reference to the constant pool item that is already in pool, that matches this one.
 boolean isEqual(ConstantPoolInfo cp)
          Returns true if these constant pool items are identical.
 int isType()
          return the type of this constant pool item.
 boolean read(java.io.DataInputStream dis)
           
 java.lang.String toString()
           
 void write(java.io.DataOutputStream dos, ConstantPoolInfo[] pool)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ASCIZ

public static final int ASCIZ

CLASS

public static final int CLASS

DOUBLE

public static final int DOUBLE

FIELDREF

public static final int FIELDREF

FLOAT

public static final int FLOAT

INTEGER

public static final int INTEGER

INTERFACE

public static final int INTERFACE

LONG

public static final int LONG

METHODREF

public static final int METHODREF

NAMEANDTYPE

public static final int NAMEANDTYPE

STRING

public static final int STRING

UNICODE

public static final int UNICODE
Constructor Detail

ConstantPoolInfo

public ConstantPoolInfo()
Generic constructor

ConstantPoolInfo

public ConstantPoolInfo(double value)
Construct a new ConstantPoolInfo object that is of type DOUBLE

ConstantPoolInfo

public ConstantPoolInfo(float value)
Construct a new ConstantPoolInfo object that is of type FLOAT

ConstantPoolInfo

public ConstantPoolInfo(int value)
Construct a new ConstantPoolInfo object that is of type INTEGER

ConstantPoolInfo

public ConstantPoolInfo(long value)
Construct a new ConstantPoolInfo object that is of type LONG

ConstantPoolInfo

public ConstantPoolInfo(java.lang.String value)
Construct a new ConstantPoolInfo object that is of type ASCIZ
Method Detail

indexOf

public static short indexOf(ConstantPoolInfo item,
                            ConstantPoolInfo[] pool)
                     throws java.lang.Exception

inPool

public ConstantPoolInfo inPool(ConstantPoolInfo[] pool)
Returns the reference to the constant pool item that is already in pool, that matches this one.

isEqual

public boolean isEqual(ConstantPoolInfo cp)
Returns true if these constant pool items are identical.

isType

public int isType()
return the type of this constant pool item.

read

public boolean read(java.io.DataInputStream dis)
             throws java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(java.io.DataOutputStream dos,
                  ConstantPoolInfo[] pool)
           throws java.io.IOException,
                  java.lang.Exception