jasm.attributes
Class LineNumberTable

java.lang.Object
  extended by jasm.attributes.LineNumberTable
All Implemented Interfaces:
Code.BytecodeMapAttribute, BytecodeAttribute

public class LineNumberTable
extends java.lang.Object
implements Code.BytecodeMapAttribute


Nested Class Summary
static class LineNumberTable.Entry
           
 
Nested classes/interfaces inherited from interface jasm.lang.BytecodeAttribute
BytecodeAttribute.Fn, BytecodeAttribute.Reader, BytecodeAttribute.Unknown
 
Constructor Summary
LineNumberTable(java.util.Collection<LineNumberTable.Entry> entries)
           
 
Method Summary
 void addPoolItems(java.util.Set<Constant.Info> constantPool)
          When this method is called, the attribute must add all items that it needs to the constant pool.
 void apply(java.util.List<Code.Rewrite> rewrites)
          This method accepts a list of rewrites which should be applied.
 java.util.List<LineNumberTable.Entry> entries()
           
 java.lang.String name()
           
 void print(java.io.PrintWriter output, java.util.Map<Constant.Info,java.lang.Integer> constantPool)
          This method is used to print the contents of the attribute in human-readable form, similar to that produced by "javap".
 void write(BinaryOutputStream writer, java.util.Map<Constant.Info,java.lang.Integer> constantPool)
          This method requires the attribute to write itself to the binary stream.
 void write(int[] bytecodeOffsets, BinaryOutputStream writer, java.util.Map<Constant.Info,java.lang.Integer> constantPool)
          This method requires the attribute to write itself to the binary stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineNumberTable

public LineNumberTable(java.util.Collection<LineNumberTable.Entry> entries)
Method Detail

apply

public void apply(java.util.List<Code.Rewrite> rewrites)
Description copied from interface: Code.BytecodeMapAttribute
This method accepts a list of rewrites which should be applied. For efficiency reasons, several constraints are made on the list:
  1. The rewrites are ordered by their start location, such that the first rewrite has the lowest start location
  2. The rewrites don't overlap. That is, we assume only one rewrite can be applied to any given region of bytecodes.
If the complete set of rewrites cannot be constructed according to these constraints, then it needs to be split up into several calls to this method.

Specified by:
apply in interface Code.BytecodeMapAttribute

entries

public java.util.List<LineNumberTable.Entry> entries()

name

public java.lang.String name()
Specified by:
name in interface BytecodeAttribute

write

public void write(BinaryOutputStream writer,
                  java.util.Map<Constant.Info,java.lang.Integer> constantPool)
           throws java.io.IOException
Description copied from interface: BytecodeAttribute
This method requires the attribute to write itself to the binary stream.

Specified by:
write in interface BytecodeAttribute
Throws:
java.io.IOException

write

public void write(int[] bytecodeOffsets,
                  BinaryOutputStream writer,
                  java.util.Map<Constant.Info,java.lang.Integer> constantPool)
           throws java.io.IOException
Description copied from interface: Code.BytecodeMapAttribute
This method requires the attribute to write itself to the binary stream.

Specified by:
write in interface Code.BytecodeMapAttribute
Parameters:
bytecodeOffsets - --- maps each bytecode index to its actual offset in the code block.
writer - --- stream to write attribute to
constantPool - --- map of constant pool items to their actual pool index
Throws:
java.io.IOException

addPoolItems

public void addPoolItems(java.util.Set<Constant.Info> constantPool)
Description copied from interface: BytecodeAttribute
When this method is called, the attribute must add all items that it needs to the constant pool.

Specified by:
addPoolItems in interface BytecodeAttribute

print

public void print(java.io.PrintWriter output,
                  java.util.Map<Constant.Info,java.lang.Integer> constantPool)
           throws java.io.IOException
Description copied from interface: BytecodeAttribute
This method is used to print the contents of the attribute in human-readable form, similar to that produced by "javap".

Specified by:
print in interface BytecodeAttribute
Throws:
java.io.IOException


Copyright © 2013 David J. Pearce. All Rights Reserved.