javar.constantpool
Class CONSTANT_Fieldref

java.lang.Object
  |
  +--javar.constantpool.ConstantPoolEntry
        |
        +--javar.constantpool.CONSTANT_Fieldref

public class CONSTANT_Fieldref
extends ConstantPoolEntry

This is the Fieldref class that represents an entry in the constant pool

Author:
Ben Litchfield

Field Summary
 
Fields inherited from class javar.constantpool.ConstantPoolEntry
CLASS_CODE, DOUBLE_CODE, FIELD_REF_CODE, FLOAT_CODE, index, INTEGER_CODE, INTERFACE_METHOD_REF_CODE, LONG_CODE, METHOD_REF_CODE, NAME_AND_TYPE_CODE, pool, STRING_CODE, UTF8_CODE
 
Constructor Summary
CONSTANT_Fieldref(ConstantPool p)
          Constructor
 
Method Summary
 CONSTANT_Classref getClassEntry()
          This will get the Class as an entry.
 long getClassIndex()
          This will get the index to the class reference for this field
 byte getCode()
          This is the code for this constant
 CONSTANT_NameAndType getNameAndTypeEntry()
          This will get the name and type as an entry.
 long getNameAndTypeIndex()
          This will get the index to the name and type reference for this field
 void load(DataInputStream in)
          This will read in whatever data is neccessary to create this entry
 void setClassIndex(long classIndex)
          This will set the index to the class entry for this field
 void setNameAndTypeIndex(long nameAndTypeIndex)
          This will set the index to the name and type entry for this field
 byte[] toBytes()
          This will take the entry and convert it into bytes.
 String toString()
          This will print a string rep of the class
 
Methods inherited from class javar.constantpool.ConstantPoolEntry
getIndex, setIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CONSTANT_Fieldref

public CONSTANT_Fieldref(ConstantPool p)
Constructor

Method Detail

getCode

public byte getCode()
This is the code for this constant

Specified by:
getCode in class ConstantPoolEntry
Returns:
code for constant

setClassIndex

public void setClassIndex(long classIndex)
This will set the index to the class entry for this field

Parameters:
classIndex - An index in the constant pool pointing to a class

getClassIndex

public long getClassIndex()
This will get the index to the class reference for this field

Returns:
The index into the constant pool that points to a class

getClassEntry

public CONSTANT_Classref getClassEntry()
This will get the Class as an entry.

Returns:
the class of this field

setNameAndTypeIndex

public void setNameAndTypeIndex(long nameAndTypeIndex)
This will set the index to the name and type entry for this field

Parameters:
nameAndTypeIndex - An index in the constant pool pointing to a name and type entry

getNameAndTypeIndex

public long getNameAndTypeIndex()
This will get the index to the name and type reference for this field

Returns:
The index into the constant pool that points to a name and type entry

getNameAndTypeEntry

public CONSTANT_NameAndType getNameAndTypeEntry()
This will get the name and type as an entry.

Returns:
the name and type of this field

load

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

Specified by:
load in class ConstantPoolEntry
Parameters:
in - the stream to read the data from

toString

public String toString()
This will print a string rep of the class

Overrides:
toString in class Object

toBytes

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

Specified by:
toBytes in class ConstantPoolEntry
Returns:
the bytes that represent this entry.
IOException