javar.constantpool
Class ConstantPoolEntry

java.lang.Object
  |
  +--javar.constantpool.ConstantPoolEntry
Direct Known Subclasses:
CONSTANT_Classref, CONSTANT_Double, CONSTANT_Fieldref, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodref, CONSTANT_Long, CONSTANT_Methodref, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8

public abstract class ConstantPoolEntry
extends Object

This is an abstract class that will represent an entry in the constant pool

Author:
Ben Litchfield (ben@csh.rit.edu)

Field Summary
static byte CLASS_CODE
           
static byte DOUBLE_CODE
           
static byte FIELD_REF_CODE
           
static byte FLOAT_CODE
           
protected  long index
           
static byte INTEGER_CODE
           
static byte INTERFACE_METHOD_REF_CODE
           
static byte LONG_CODE
           
static byte METHOD_REF_CODE
           
static byte NAME_AND_TYPE_CODE
           
protected  ConstantPool pool
           
static byte STRING_CODE
           
static byte UTF8_CODE
           
 
Constructor Summary
ConstantPoolEntry(ConstantPool p)
          Constructor
 
Method Summary
abstract  byte getCode()
          This will return the code of this entry
 long getIndex()
          This will tell the index of this entry
abstract  void load(DataInputStream in)
          This will read in whatever data is neccessary to create this entry
 void setIndex(int i)
          This will set the index for this entry
abstract  byte[] toBytes()
          This will take the entry and convert it into bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF8_CODE

public static final byte UTF8_CODE
See Also:
Constant Field Values

INTEGER_CODE

public static final byte INTEGER_CODE
See Also:
Constant Field Values

FLOAT_CODE

public static final byte FLOAT_CODE
See Also:
Constant Field Values

LONG_CODE

public static final byte LONG_CODE
See Also:
Constant Field Values

DOUBLE_CODE

public static final byte DOUBLE_CODE
See Also:
Constant Field Values

CLASS_CODE

public static final byte CLASS_CODE
See Also:
Constant Field Values

STRING_CODE

public static final byte STRING_CODE
See Also:
Constant Field Values

FIELD_REF_CODE

public static final byte FIELD_REF_CODE
See Also:
Constant Field Values

METHOD_REF_CODE

public static final byte METHOD_REF_CODE
See Also:
Constant Field Values

INTERFACE_METHOD_REF_CODE

public static final byte INTERFACE_METHOD_REF_CODE
See Also:
Constant Field Values

NAME_AND_TYPE_CODE

public static final byte NAME_AND_TYPE_CODE
See Also:
Constant Field Values

pool

protected ConstantPool pool

index

protected long index
Constructor Detail

ConstantPoolEntry

public ConstantPoolEntry(ConstantPool p)
Constructor

Method Detail

getCode

public abstract byte getCode()
This will return the code of this entry

Returns:
number representing the type of entry

load

public abstract void load(DataInputStream in)
This will read in whatever data is neccessary to create this entry

Parameters:
in - the stream to read the data from

getIndex

public long getIndex()
This will tell the index of this entry

Returns:
index

toBytes

public abstract byte[] toBytes()
                        throws IOException
This will take the entry and convert it into bytes.

Returns:
the bytes that represent this entry.
IOException

setIndex

public void setIndex(int i)
This will set the index for this entry