jef.dna.attributes.impl
Class LineNumberTableEntry

java.lang.Object
  extended by jef.dna.attributes.impl.LineNumberTableEntry
All Implemented Interfaces:
java.lang.Cloneable, LineNumberTableEntry, BytesCountable

public class LineNumberTableEntry
extends java.lang.Object
implements LineNumberTableEntry

Class representing a Line Number Table instance's entry.

Author:
Francesco Russo frusso@cs.unibo.it

Field Summary
protected static Logger logger
           
 
Constructor Summary
LineNumberTableEntry()
          Creates a new instance of LineNumberTableEntry
 
Method Summary
 java.lang.Object clone()
          The clone() method will return a new instance whose reference to the containing LineNumberTableAttribute is not modified.
 void fromStream(java.io.DataInputStream dis)
          Reads the line number table entry from the given input stream.
 LineNumberTableAttribute getAttributeContainer()
          Get the LineNumberTableAttribute containing the current LineNumberTableEntry
 int getBytesCount()
          This method must return the overall number of bytes required by the component implementing this interface.
 int getLineNumber()
          The value of the line_number item must give the corresponding line number in the original source file
 int getStartPc()
          The value of the start_pc item must indicate the index into the code array at which the code for a new line in the original source file begins.
 void setAttributeContainer(LineNumberTableAttribute attr)
          Set the LineNumberTableAttribute containing the current LineNumberTableEntry
 void setLineNumber(int lineNumber)
          The value of the line_number item must give the corresponding line number in the original source file
 void setStartPc(int startPc)
          The value of the start_pc item must indicate the index into the code array at which the code for a new line in the original source file begins.
 void toStream(java.io.DataOutputStream dos)
          Writes the line number table entry to the given output stream.
 void validate()
          Performs the validation of the current LineNumberTableEntry.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static Logger logger
Constructor Detail

LineNumberTableEntry

public LineNumberTableEntry()
Creates a new instance of LineNumberTableEntry

Method Detail

setStartPc

public void setStartPc(int startPc)
Description copied from interface: LineNumberTableEntry
The value of the start_pc item must indicate the index into the code array at which the code for a new line in the original source file begins. The value of start_pc must be less than the value of the code_length item of the Code attribute of which this LineNumberTable is an attribute

Specified by:
setStartPc in interface LineNumberTableEntry
Parameters:
startPc - A valid value as defined above

getStartPc

public int getStartPc()
Description copied from interface: LineNumberTableEntry
The value of the start_pc item must indicate the index into the code array at which the code for a new line in the original source file begins. The value of start_pc must be less than the value of the code_length item of the Code attribute of which this LineNumberTable is an attribute

Specified by:
getStartPc in interface LineNumberTableEntry
Returns:
int A valid value as defined above

setLineNumber

public void setLineNumber(int lineNumber)
Description copied from interface: LineNumberTableEntry
The value of the line_number item must give the corresponding line number in the original source file

Specified by:
setLineNumber in interface LineNumberTableEntry
Parameters:
lineNumber - The line number value

getLineNumber

public int getLineNumber()
Description copied from interface: LineNumberTableEntry
The value of the line_number item must give the corresponding line number in the original source file

Specified by:
getLineNumber in interface LineNumberTableEntry
Returns:
int The line number value

setAttributeContainer

public void setAttributeContainer(LineNumberTableAttribute attr)
Description copied from interface: LineNumberTableEntry
Set the LineNumberTableAttribute containing the current LineNumberTableEntry

Specified by:
setAttributeContainer in interface LineNumberTableEntry
Parameters:
attr - The container

getAttributeContainer

public LineNumberTableAttribute getAttributeContainer()
Description copied from interface: LineNumberTableEntry
Get the LineNumberTableAttribute containing the current LineNumberTableEntry

Specified by:
getAttributeContainer in interface LineNumberTableEntry
Returns:
LineNumberTableAttribute The container

toStream

public void toStream(java.io.DataOutputStream dos)
              throws java.io.IOException
Description copied from interface: LineNumberTableEntry
Writes the line number table entry to the given output stream.

Specified by:
toStream in interface LineNumberTableEntry
Parameters:
dos - The output stream the line number table entry has to be written to
Throws:
java.io.IOException - Something went wrong with the given stream

fromStream

public void fromStream(java.io.DataInputStream dis)
                throws java.io.IOException
Description copied from interface: LineNumberTableEntry
Reads the line number table entry from the given input stream.

Specified by:
fromStream in interface LineNumberTableEntry
Parameters:
dis - The input stream the line number table entry has to be read from
Throws:
java.io.IOException - Something went wrong with the given stream

validate

public void validate()
              throws MissingAttributeContainerException,
                     LineNumberTableEntryValidationException
Description copied from interface: LineNumberTableEntry
Performs the validation of the current LineNumberTableEntry.

Specified by:
validate in interface LineNumberTableEntry
Throws:
MissingAttributeContainerException
LineNumberTableEntryValidationException

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
The clone() method will return a new instance whose reference to the containing LineNumberTableAttribute is not modified.

Specified by:
clone in interface LineNumberTableEntry
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getBytesCount

public int getBytesCount()
Description copied from interface: BytesCountable
This method must return the overall number of bytes required by the component implementing this interface.

Specified by:
getBytesCount in interface BytesCountable