FileDocCategorySizeDatePackage
StackMapType.javaAPI DocJava SE 6 API5859Tue Jun 10 00:22:18 BST 2008com.sun.org.apache.bcel.internal.classfile

StackMapType

public final class StackMapType extends Object implements Cloneable
This class represents the type of a local variable or item on stack used in the StackMap entries.
version
$Id: StackMapType.java,v 1.1.2.1 2005/07/31 23:46:33 jeffsuttor Exp $
author
M. Dahm
see
StackMapEntry
see
StackMap
see
Constants

Fields Summary
private byte
type
private int
index
private ConstantPool
constant_pool
Constructors Summary
StackMapType(DataInputStream file, ConstantPool constant_pool)
Construct object from file stream.

param
file Input stream
throws
IOException


                
       
  
    this(file.readByte(), -1, constant_pool);

    if(hasIndex())
      setIndex(file.readShort());

    setConstantPool(constant_pool);
  
public StackMapType(byte type, int index, ConstantPool constant_pool)

param
type type tag as defined in the Constants interface
param
index index to constant pool, or byte code offset

    setType(type);
    setIndex(index);
    setConstantPool(constant_pool);
  
Methods Summary
public com.sun.org.apache.bcel.internal.classfile.StackMapTypecopy()

return
deep copy of this object

    try {
      return (StackMapType)clone();
    } catch(CloneNotSupportedException e) {}

    return null;
  
public final voiddump(java.io.DataOutputStream file)
Dump type entries to file.

param
file Output file stream
throws
IOException

    file.writeByte(type);
    if(hasIndex())
      file.writeShort(getIndex());
  
public final com.sun.org.apache.bcel.internal.classfile.ConstantPoolgetConstantPool()

return
Constant pool used by this object.

 return constant_pool; 
public intgetIndex()

return
index to constant pool if type == ITEM_Object, or offset in byte code, if type == ITEM_NewObject, and -1 otherwise

 return index; 
public bytegetType()

 return type; 
public final booleanhasIndex()

return
true, if type is either ITEM_Object or ITEM_NewObject

    return ((type == Constants.ITEM_Object) ||
	    (type == Constants.ITEM_NewObject));
  
private java.lang.StringprintIndex()

    if(type == Constants.ITEM_Object)
      return ", class=" + constant_pool.constantToString(index, Constants.CONSTANT_Class);
    else if(type == Constants.ITEM_NewObject)
      return ", offset=" + index;
    else
      return "";
  
public final voidsetConstantPool(com.sun.org.apache.bcel.internal.classfile.ConstantPool constant_pool)

param
constant_pool Constant pool to be used for this object.

    this.constant_pool = constant_pool;
  
public voidsetIndex(int t)

 index = t; 
public voidsetType(byte t)

    if((t < Constants.ITEM_Bogus) || (t > Constants.ITEM_NewObject))
      throw new RuntimeException("Illegal type for StackMapType: " + t);
    type = t;
  
public final java.lang.StringtoString()

return
String representation

    return "(type=" + Constants.ITEM_NAMES[type] + printIndex() + ")";