FileDocCategorySizeDatePackage
CONSTANT_info.javaAPI DocAndroid 1.5 API6454Wed May 06 22:41:16 BST 2009com.vladium.jcd.cls.constant

CONSTANT_info

public abstract class CONSTANT_info extends Object implements Cloneable, com.vladium.jcd.compiler.IClassFormatOutput
An abstract base for all other CONSTANT_XXX_info structures. See $4.4 in VM spec 1.0 for all such structure definitions.
author
(C) 2001, Vlad Roubtsov

Fields Summary
Constructors Summary
protected CONSTANT_info()

    
Methods Summary
public abstract java.lang.Objectaccept(ICONSTANTVisitor visitor, java.lang.Object ctx)

public java.lang.Objectclone()
Chains to super.clone() and removes CloneNotSupportedException from the method signature.

        try
        {
            return super.clone ();
        }
        catch (CloneNotSupportedException e)
        {
            throw new InternalError (e.toString ());
        }
    
public static com.vladium.jcd.cls.constant.CONSTANT_infonew_CONSTANT_info(com.vladium.jcd.lib.UDataInputStream bytes)
Virtual constructor method for all CONSTANT_XXX_info structures.

        byte tag = bytes.readByte ();                                                                                   
        
        switch (tag)
        {
        case CONSTANT_Utf8_info.TAG:
            return new CONSTANT_Utf8_info (bytes);
            
        case CONSTANT_Integer_info.TAG:
            return new CONSTANT_Integer_info (bytes);
            
        case CONSTANT_Float_info.TAG:
            return new CONSTANT_Float_info (bytes);
            
        case CONSTANT_Long_info.TAG:
            return new CONSTANT_Long_info (bytes);
            
        case CONSTANT_Double_info.TAG:
            return new CONSTANT_Double_info (bytes);
        
            
        case CONSTANT_Class_info.TAG:
            return new CONSTANT_Class_info (bytes);
            
        case CONSTANT_String_info.TAG:
            return new CONSTANT_String_info (bytes);
            
            
        case CONSTANT_Fieldref_info.TAG:
            return new CONSTANT_Fieldref_info (bytes);
            
        case CONSTANT_Methodref_info.TAG:
            return new CONSTANT_Methodref_info (bytes);
            
        case CONSTANT_InterfaceMethodref_info.TAG:
            return new CONSTANT_InterfaceMethodref_info (bytes);
            
            
        case CONSTANT_NameAndType_info.TAG:
            return new CONSTANT_NameAndType_info (bytes);
            
        default: throw new IllegalStateException ("CONSTANT_info: invalid tag value [" + tag + ']");
                 
        } // end of switch
    
public abstract bytetag()
Returns the tag byte for this CONSTANT type [this data is static class data].

public static java.lang.StringtagToString(com.vladium.jcd.cls.constant.CONSTANT_info constant)

        switch (constant.tag ())
        {
        case CONSTANT_Utf8_info.TAG:
            return "CONSTANT_Utf8";
            
        case CONSTANT_Integer_info.TAG:
            return "CONSTANT_Integer";
            
        case CONSTANT_Float_info.TAG:
            return "CONSTANT_Float";
            
        case CONSTANT_Long_info.TAG:
            return "CONSTANT_Long";
            
        case CONSTANT_Double_info.TAG:
            return "CONSTANT_Double";
        
            
        case CONSTANT_Class_info.TAG:
            return "CONSTANT_Class";
            
        case CONSTANT_String_info.TAG:
            return "CONSTANT_String";
            
            
        case CONSTANT_Fieldref_info.TAG:
            return "CONSTANT_Fieldref";
            
        case CONSTANT_Methodref_info.TAG:
            return "CONSTANT_Methodref";
            
        case CONSTANT_InterfaceMethodref_info.TAG:
            return "CONSTANT_InterfaceMethodref";
            
            
        case CONSTANT_NameAndType_info.TAG:
            return "CONSTANT_NameAndType";
            
        default: throw new IllegalStateException ("CONSTANT_info: invalid tag value [" + constant.tag () + ']");
                 
        } // end of switch
    
public abstract java.lang.StringtoString()

public intwidth()
Returns the number of constant pool index slots occupied by this CONSTANT type. This implementation defaults to returning '1'.

see
CONSTANT_Long_info
see
CONSTANT_Long_info
return
int

        return 1;
    
public voidwriteInClassFormat(com.vladium.jcd.lib.UDataOutputStream out)

    
        out.writeByte (tag ());