javar.constantpool
Class CONSTANT_NameAndType

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

public class CONSTANT_NameAndType
extends ConstantPoolEntry

This is the Name and Type ass that represents an entry in the constant pool

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

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_NameAndType(ConstantPool p)
          Constructor
 
Method Summary
 byte getCode()
          This is the code for this constant
 long getName()
          This will get the name of this name and type
 String getNameAsString()
          This will get the name of this name and type
 long getType()
          This will get the type of this name and type
 String getTypeAsString()
          This will get the type of this name and type
 void load(DataInputStream in)
          This will read in whatever data is neccessary to create this entry
 void setName(long name)
          This will set the name of this.
 void setType(long type)
          This will set the type of this
 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_NameAndType

public CONSTANT_NameAndType(ConstantPool p)
Constructor

Method Detail

setName

public void setName(long name)
This will set the name of this.

Parameters:
name -

getName

public long getName()
This will get the name of this name and type

Returns:
an index into the constant pool

getNameAsString

public String getNameAsString()
This will get the name of this name and type


getTypeAsString

public String getTypeAsString()
This will get the type of this name and type


setType

public void setType(long type)
This will set the type of this

Parameters:
type -

getType

public long getType()
This will get the type of this name and type


getCode

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

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

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