jef.dna.attributes
Interface LocalVariableTableEntry

All Superinterfaces:
BytesCountable, java.lang.Cloneable
All Known Implementing Classes:
LocalVariableTableEntry

public interface LocalVariableTableEntry
extends java.lang.Cloneable, BytesCountable

Class representing a Local Variable instance's table entry.

Author:
Francesco Russo frusso@cs.unibo.it

Method Summary
 java.lang.Object clone()
           
 void fromStream(java.io.DataInputStream dis)
          Deserializes the given local variable table entry from the provided input stream.
 LocalVariableTableAttribute getAttributeContainer()
          Set the reference to the LocalVariableTableAttribute containing the current LocalVariableTableEntry.
 int getDescriptorIndex()
          The value of the descriptor_index item must be a valid index into the constant_pool table.
 int getIndex()
          The given local variable must be at index in the local variable array of the current frame.
 int getLength()
          Returns the current value of length
 int getNameIndex()
          The value of the name_index item must be a valid index into the constant_pool table.
 int getStartPc()
          Returns the current value of the startPc
 void setAttributeContainer(LocalVariableTableAttribute attribute)
          Set the reference to the LocalVariableTableAttribute containing the current LocalVariableTableEntry.
 void setDescriptorIndex(int descIndex)
          The value of the descriptor_index item must be a valid index into the constant_pool table.
 void setIndex(int index)
          The given local variable must be at index in the local variable array of the current frame.
 void setLength(int length)
          The given local variable must have a value at indices into the code array in the interval [start_pc, start_pc+length], that is, between start_pc and start_pc+length inclusive.
 void setNameIndex(int nameIndex)
          The value of the name_index item must be a valid index into the constant_pool table.
 void setStartPc(int startPc)
          The given local variable must have a value at indices into the code array in the interval [start_pc, start_pc+length], that is, between start_pc and start_pc+length inclusive.
 void toStream(java.io.DataOutputStream dos)
          Serializes the given local variable table entry to the provided output stream.
 void updateRefs(int offset)
          Updates all the references to entries into the constant pool table by the given offset
 void validate()
          Perform validation over the current LocalVariableTableEntry
 
Methods inherited from interface jef.dna.util.BytesCountable
getBytesCount
 

Method Detail

setStartPc

void setStartPc(int startPc)
The given local variable must have a value at indices into the code array in the interval [start_pc, start_pc+length], that is, between start_pc and start_pc+length inclusive. The value of start_pc must be a valid index into the code array of this Code attribute and must be the index of the opcode of an instruction. Either the value of start_pc+length must be a valid index into the code array of this Code attribute and be the index of the opcode of an instruction, or it must be the first index beyond the end of that code array

Parameters:
startPc - The value of the startPc

getStartPc

int getStartPc()
Returns the current value of the startPc

Returns:
int The value of the startPc

setLength

void setLength(int length)
The given local variable must have a value at indices into the code array in the interval [start_pc, start_pc+length], that is, between start_pc and start_pc+length inclusive. The value of start_pc must be a valid index into the code array of this Code attribute and must be the index of the opcode of an instruction. Either the value of start_pc+length must be a valid index into the code array of this Code attribute and be the index of the opcode of an instruction, or it must be the first index beyond the end of that code array

Parameters:
length - The value of length

getLength

int getLength()
Returns the current value of length

Returns:
int The value of length

setNameIndex

void setNameIndex(int nameIndex)
The value of the name_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must contain a CONSTANT_Utf8_info structure representing a valid local variable name stored as a simple name.

Parameters:
nameIndex - A valid index into the constant pool table as defined above

getNameIndex

int getNameIndex()
The value of the name_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must contain a CONSTANT_Utf8_info structure representing a valid local variable name stored as a simple name.

Returns:
int A valid index into the constant pool table as defined above

setDescriptorIndex

void setDescriptorIndex(int descIndex)
The value of the descriptor_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must contain a CONSTANT_Utf8_info structure representing a field descriptor encoding the type of a local variable in the source program.

Parameters:
descIndex - A valid index into tha constant pool table as defined above

getDescriptorIndex

int getDescriptorIndex()
The value of the descriptor_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must contain a CONSTANT_Utf8_info structure representing a field descriptor encoding the type of a local variable in the source program.

Returns:
int A valid index into tha constant pool table as defined above

setIndex

void setIndex(int index)
The given local variable must be at index in the local variable array of the current frame. If the local variable at index is of type double or long, it occupies both index and index+1.

Parameters:
index - A valid index as described above

getIndex

int getIndex()
The given local variable must be at index in the local variable array of the current frame. If the local variable at index is of type double or long, it occupies both index and index+1.

Returns:
int A valid index as described above

setAttributeContainer

void setAttributeContainer(LocalVariableTableAttribute attribute)
Set the reference to the LocalVariableTableAttribute containing the current LocalVariableTableEntry.

Parameters:
attribute - The container

getAttributeContainer

LocalVariableTableAttribute getAttributeContainer()
Set the reference to the LocalVariableTableAttribute containing the current LocalVariableTableEntry.

Returns:
LocalVariableTableAttribute The container

toStream

void toStream(java.io.DataOutputStream dos)
              throws java.io.IOException
Serializes the given local variable table entry to the provided output stream.

Parameters:
dos - The stream the current local variable table entry has to be written to
Throws:
java.io.IOException

fromStream

void fromStream(java.io.DataInputStream dis)
                throws java.io.IOException
Deserializes the given local variable table entry from the provided input stream.

Parameters:
dis - The stream the current local variable table entry has to be read from
Throws:
java.io.IOException

updateRefs

void updateRefs(int offset)
Updates all the references to entries into the constant pool table by the given offset

Parameters:
offset - The offset for performing the update

validate

void validate()
              throws LocalVariableTableEntryValidationException,
                     MissingDnaContainerException,
                     MissingAttributeContainerException
Perform validation over the current LocalVariableTableEntry

Throws:
LocalVariableTableEntryValidationException
MissingDnaContainerException
MissingAttributeContainerException

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException