wt.loader
Class ConstantPoolInfo

java.lang.Object
  extended bywt.loader.ConstantPoolInfo

public class ConstantPoolInfo
extends 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.

See Also:
ClassFile

Field Summary
(package private)  ConstantPoolInfo arg1
           
(package private)  ConstantPoolInfo arg2
           
static int ASCIZ
           
static int CLASS
           
static int DOUBLE
           
(package private)  double doubleValue
           
static int FIELDREF
           
static int FLOAT
           
(package private)  float floatValue
           
(package private)  short index1
           
(package private)  short index2
           
static int INTEGER
           
static int INTERFACE
           
(package private)  int intValue
           
static int LONG
           
(package private)  long longValue
           
static int METHODREF
           
(package private)  String name
           
static int NAMEANDTYPE
           
static int STRING
           
(package private)  String strValue
           
(package private)  int type
           
static int UNICODE
           
private static String versionID
           
 
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(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(DataInputStream dis)
           
 String toString()
           
 void write(DataOutputStream dos, ConstantPoolInfo[] pool)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

type

int type

name

String name

arg1

ConstantPoolInfo arg1

arg2

ConstantPoolInfo arg2

index1

short index1

index2

short index2

strValue

String strValue

intValue

int intValue

longValue

long longValue

floatValue

float floatValue

doubleValue

double doubleValue

CLASS

public static final int CLASS
See Also:
Constant Field Values

FIELDREF

public static final int FIELDREF
See Also:
Constant Field Values

METHODREF

public static final int METHODREF
See Also:
Constant Field Values

STRING

public static final int STRING
See Also:
Constant Field Values

INTEGER

public static final int INTEGER
See Also:
Constant Field Values

FLOAT

public static final int FLOAT
See Also:
Constant Field Values

LONG

public static final int LONG
See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
See Also:
Constant Field Values

INTERFACE

public static final int INTERFACE
See Also:
Constant Field Values

NAMEANDTYPE

public static final int NAMEANDTYPE
See Also:
Constant Field Values

ASCIZ

public static final int ASCIZ
See Also:
Constant Field Values

UNICODE

public static final int UNICODE
See Also:
Constant Field Values
Constructor Detail

ConstantPoolInfo

public ConstantPoolInfo(String value)
Construct a new ConstantPoolInfo object that is of type ASCIZ


ConstantPoolInfo

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


ConstantPoolInfo

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


ConstantPoolInfo

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


ConstantPoolInfo

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


ConstantPoolInfo

public ConstantPoolInfo()
Generic constructor

Method Detail

isType

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


read

public boolean read(DataInputStream dis)
             throws IOException
Throws:
IOException

write

public void write(DataOutputStream dos,
                  ConstantPoolInfo[] pool)
           throws IOException,
                  Exception
Throws:
IOException
Exception

toString

public String toString()

indexOf

public static short indexOf(ConstantPoolInfo item,
                            ConstantPoolInfo[] pool)
                     throws Exception
Throws:
Exception

isEqual

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


inPool

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