FileDocCategorySizeDatePackage
AttCode.javaAPI DocAndroid 5.1 API4199Thu Mar 12 22:18:30 GMT 2015com.android.dx.cf.attrib

AttCode

public final class AttCode extends BaseAttribute
Attribute class for standard {@code Code} attributes.

Fields Summary
public static final String
ATTRIBUTE_NAME
{@code non-null;} attribute name for attributes of this type
private final int
maxStack
{@code >= 0;} the stack size
private final int
maxLocals
{@code >= 0;} the number of locals
private final com.android.dx.cf.code.BytecodeArray
code
{@code non-null;} array containing the bytecode per se
private final com.android.dx.cf.code.ByteCatchList
catches
{@code non-null;} the exception table
private final com.android.dx.cf.iface.AttributeList
attributes
{@code 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 {@code >= 0;} the stack size
param
maxLocals {@code >= 0;} the number of locals
param
code {@code non-null;} array containing the bytecode per se
param
catches {@code non-null;} the exception table
param
attributes {@code 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
{@code non-null;} the attribute list

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

return
{@code non-null;} the exception table

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

return
{@code non-null;} the bytecode array

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

return
{@code >= 0;} the number of locals

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

return
{@code >= 0;} the maximum stack size

        return maxStack;