FileDocCategorySizeDatePackage
JConstant.javaAPI DocphoneME MR2 API (J2ME)4254Wed May 02 18:00:40 BST 2007com.sun.satsa.jcrmic.classfile.constants

JConstant

public abstract class JConstant extends Object
This class is the base class for all constants. It also defines a factory method for creating a constant based on the constant type

Fields Summary
public static final int
CONSTANT_UTF8
Constant pool entry tag.
public static final int
CONSTANT_INTEGER
Constant pool entry tag.
public static final int
CONSTANT_FLOAT
Constant pool entry tag.
public static final int
CONSTANT_LONG
Constant pool entry tag.
public static final int
CONSTANT_DOUBLE
Constant pool entry tag.
public static final int
CONSTANT_CLASS
Constant pool entry tag.
public static final int
CONSTANT_STRING
Constant pool entry tag.
public static final int
CONSTANT_FIELDREF
Constant pool entry tag.
public static final int
CONSTANT_METHODREF
Constant pool entry tag.
public static final int
CONSTANT_INTERFACE_METHODREF
Constant pool entry tag.
public static final int
CONSTANT_NAME_AND_TYPE
Constant pool entry tag.
protected JConstantPool
cp
Constant pool reference.
protected boolean
resolved
'Resolved' flag.
Constructors Summary
public JConstant(JConstantPool cp)
Constructor.

param
cp constant pool reference


               
       
        this.cp = cp;
    
Methods Summary
public static final com.sun.satsa.jcrmic.classfile.constants.JConstantcreate(int tag, JConstantPool cp)
Factory method for constant pool entry creation.

param
tag constant pool entry type tag
param
cp constant pool reference
return
constant pool entry object


                                 
            

        switch (tag) {
            case CONSTANT_CLASS:
                return new JConstantClass(cp);
            case CONSTANT_UTF8:
                return new JConstantUtf8(cp);
            case CONSTANT_FIELDREF:
                return new JConstantFieldRef(cp);
            case CONSTANT_METHODREF:
                return new JConstantMethodRef(cp);
            case CONSTANT_INTERFACE_METHODREF:
                return new JConstantInterfaceMethodRef(cp);
            case CONSTANT_NAME_AND_TYPE:
                return new JConstantNameAndType(cp);
            case CONSTANT_STRING:
                return new JConstantString(cp);
            case CONSTANT_INTEGER:
                return new JConstantInteger(cp);
            case CONSTANT_FLOAT:
                return new JConstantFloat(cp);
            case CONSTANT_LONG:
                return new JConstantLong(cp);
            case CONSTANT_DOUBLE:
                return new JConstantDouble(cp);
            default:
                return null;

        }
    
public abstract voidparse(java.io.DataInputStream dis)
Parses constant pool entry.

param
dis input stream
throws
IOException if I/O exception occurs