org.apache.xalan.xsltc.compiler.util
Class MethodGenerator.Chunk

java.lang.Object
  extended by org.apache.xalan.xsltc.compiler.util.MethodGenerator.Chunk
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
MethodGenerator

private static class MethodGenerator.Chunk
extends java.lang.Object
implements java.lang.Comparable

Used to keep track of an outlineable chunk of instructions in the current method. See OutlineableChunkStart and OutlineableChunkEnd for more information.


Field Summary
private  InstructionHandle m_end
          org.apache.bcel.generic.InstructionHandle of the first instruction in the outlineable chunk.
private  int m_size
          Number of bytes in the instructions contained in this outlineable chunk.
private  InstructionHandle m_start
          InstructionHandle of the first instruction in the outlineable chunk.
 
Constructor Summary
MethodGenerator.Chunk(InstructionHandle start, InstructionHandle end)
          Constructor for an outlineable MethodGenerator.Chunk.
 
Method Summary
 int compareTo(java.lang.Object comparand)
          Implements the java.util.Comparable.compareTo(Object) method.
(package private)  InstructionHandle getChunkEnd()
          Getter method for the end of this MethodGenerator.Chunk
(package private)  int getChunkSize()
          The size of this MethodGenerator.Chunk
(package private)  InstructionHandle getChunkStart()
          Getter method for the start of this
(package private)  boolean isAdjacentTo(MethodGenerator.Chunk neighbour)
          Determines whether this outlineable MethodGenerator.Chunk is followed immediately by the argument MethodGenerator.Chunk, with no other intervening instructions, including OutlineableChunkStart or OutlineableChunkEnd instructions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_start

private InstructionHandle m_start
InstructionHandle of the first instruction in the outlineable chunk.


m_end

private InstructionHandle m_end
org.apache.bcel.generic.InstructionHandle of the first instruction in the outlineable chunk.


m_size

private int m_size
Number of bytes in the instructions contained in this outlineable chunk.

Constructor Detail

MethodGenerator.Chunk

MethodGenerator.Chunk(InstructionHandle start,
                      InstructionHandle end)

Constructor for an outlineable MethodGenerator.Chunk.

Preconditions:

Parameters:
start - The InstructionHandle of the first instruction in the outlineable chunk.
end - The InstructionHandle of the last instruction in the outlineable chunk.
Method Detail

isAdjacentTo

boolean isAdjacentTo(MethodGenerator.Chunk neighbour)
Determines whether this outlineable MethodGenerator.Chunk is followed immediately by the argument MethodGenerator.Chunk, with no other intervening instructions, including OutlineableChunkStart or OutlineableChunkEnd instructions.

Parameters:
neighbour - an outlineable MethodGenerator.Chunk
Returns:
true if and only if the argument chunk immediately follows this chunk

getChunkStart

InstructionHandle getChunkStart()
Getter method for the start of this

Returns:
the org.apache.bcel.generic.InstructionHandle of the start of this chunk

getChunkEnd

InstructionHandle getChunkEnd()
Getter method for the end of this MethodGenerator.Chunk

Returns:
the InstructionHandle of the start of this chunk

getChunkSize

int getChunkSize()
The size of this MethodGenerator.Chunk

Returns:
the number of bytes in the byte code represented by this chunk.

compareTo

public int compareTo(java.lang.Object comparand)
Implements the java.util.Comparable.compareTo(Object) method.

Specified by:
compareTo in interface java.lang.Comparable
Returns:
  • A positive int if the length of this chunk in bytes is greater than that of comparand
  • A negative int if the length of this chunk in bytes is less than that of comparand
  • Zero, otherwise.