FileDocCategorySizeDatePackage
AttCode.javaAPI DocAndroid 1.5 API4100Wed May 06 22:41:02 BST 2009com.android.dx.cf.attrib

AttCode

public final class AttCode extends BaseAttribute
Attribute class for standard Code attributes.

Fields Summary
public static final String
ATTRIBUTE_NAME
non-null; attribute name for attributes of this type
private final int
maxStack
>= 0; the stack size
private final int
maxLocals
>= 0; the number of locals
private final com.android.dx.cf.code.BytecodeArray
code
non-null; array containing the bytecode per se
private final com.android.dx.cf.code.ByteCatchList
catches
non-null; the exception table
private final com.android.dx.cf.iface.AttributeList
attributes
non-null; the associated list of attributes
Constructors Summary
public AttCode(int maxStack, int maxLocals, com.android.dx.cf.code.BytecodeArray code, com.android.dx.cf.code.ByteCatchList catches, com.android.dx.cf.iface.AttributeList attributes)
Constructs an instance.

param
maxStack >= 0; the stack size
param
maxLocals >= 0; the number of locals
param
code non-null; array containing the bytecode per se
param
catches non-null; the exception table
param
attributes non-null; the associated list of attributes


                                                   
          
                       
        super(ATTRIBUTE_NAME);

        if (maxStack < 0) {
            throw new IllegalArgumentException("maxStack < 0");
        }

        if (maxLocals < 0) {
            throw new IllegalArgumentException("maxLocals < 0");
        }

        if (code == null) {
            throw new NullPointerException("code == null");
        }

        try {
            if (catches.isMutable()) {
                throw new MutabilityException("catches.isMutable()");
            }
        } catch (NullPointerException ex) {
            // Translate the exception.
            throw new NullPointerException("catches == null");
        }

        try {
            if (attributes.isMutable()) {
                throw new MutabilityException("attributes.isMutable()");
            }
        } catch (NullPointerException ex) {
            // Translate the exception.
            throw new NullPointerException("attributes == null");
        }

        this.maxStack = maxStack;
        this.maxLocals = maxLocals;
        this.code = code;
        this.catches = catches;
        this.attributes = attributes;
    
Methods Summary
public intbyteLength()

        return 10 + code.byteLength() + catches.byteLength() +
            attributes.byteLength();
    
public com.android.dx.cf.iface.AttributeListgetAttributes()
Gets the associated attribute list.

return
non-null; the attribute list

        return attributes;
    
public com.android.dx.cf.code.ByteCatchListgetCatches()
Gets the exception table.

return
non-null; the exception table

        return catches;
    
public com.android.dx.cf.code.BytecodeArraygetCode()
Gets the bytecode array.

return
non-null; the bytecode array

        return code;
    
public intgetMaxLocals()
Gets the number of locals.

return
>= 0; the number of locals

        return maxLocals;
    
public intgetMaxStack()
Gets the maximum stack size.

return
>= 0; the maximum stack size

        return maxStack;