fr.umlv.corosol.classfile.constant
Interface JConstant

All Superinterfaces:
JClassFileItem, JObject
All Known Subinterfaces:
JConstantClass, JConstantDouble, JConstantFieldref, JConstantFloat, JConstantInteger, JConstantInterfaceMethodref, JConstantLong, JConstantMethodref, JConstantNameAndType, JConstantString, JConstantUtf8, JLoadableConstant
All Known Implementing Classes:
AbstractJConstant, DefaultJConstantClass, DefaultJConstantDouble, DefaultJConstantFieldref, DefaultJConstantFloat, DefaultJConstantInteger, DefaultJConstantInterfaceMethodref, DefaultJConstantLong, DefaultJConstantMethodref, DefaultJConstantNameAndType, DefaultJConstantString, DefaultJConstantUtf8, JDK1_5JConstantClass

public interface JConstant
extends JClassFileItem

An object of the JConstant interface represents a constant pool entry. (@see #fr.umlv.corosol.classfile.constant.JConstantPool).

A constant pool entry can takes up two entries (e.g. the Constant_Double and Constant_Long entries). Then, the getLength method returns the number of entries occupied by an entry in the constant pool.

Author:
Christophe Deleray

Field Summary
static int CONSTANT_CLASS
          The CONSTANT_Class tag.
static int CONSTANT_DOUBLE
          The CONSTANT_Double tag.
static int CONSTANT_FIELDREF
          The CONSTANT_Fieldref tag.
static int CONSTANT_FLOAT
          The CONSTANT_Float tag.
static int CONSTANT_INTEGER
          The CONSTANT_Integer tag.
static int CONSTANT_INTERFACE_METHODREF
          The CONSTANT_InterfaceMethodref tag.
static int CONSTANT_LONG
          The CONSTANT_Long tag.
static int CONSTANT_METHODREF
          The CONSTANT_Methodref tag.
static int CONSTANT_NAME_AND_TYPE
          The CONSTANT_NameAndType tag.
static int CONSTANT_STRING
          The CONSTANT_String tag.
static int CONSTANT_UTF8
          The CONSTANT_Utf8 tag.
 
Method Summary
 int getLength()
          Returns the number of entries occupied by this entry in its constant pool.
 int getTag()
          Returns the tag of this constant pool entry.
 java.lang.String toString()
          Returns a string representation of this constant pool entry.
 
Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem
getConstantPool, readItem, setConstantPool, writeItem
 

Field Detail

CONSTANT_UTF8

static final int CONSTANT_UTF8
The CONSTANT_Utf8 tag.

See Also:
Constant Field Values

CONSTANT_INTEGER

static final int CONSTANT_INTEGER
The CONSTANT_Integer tag.

See Also:
Constant Field Values

CONSTANT_FLOAT

static final int CONSTANT_FLOAT
The CONSTANT_Float tag.

See Also:
Constant Field Values

CONSTANT_LONG

static final int CONSTANT_LONG
The CONSTANT_Long tag.

See Also:
Constant Field Values

CONSTANT_DOUBLE

static final int CONSTANT_DOUBLE
The CONSTANT_Double tag.

See Also:
Constant Field Values

CONSTANT_CLASS

static final int CONSTANT_CLASS
The CONSTANT_Class tag.

See Also:
Constant Field Values

CONSTANT_STRING

static final int CONSTANT_STRING
The CONSTANT_String tag.

See Also:
Constant Field Values

CONSTANT_FIELDREF

static final int CONSTANT_FIELDREF
The CONSTANT_Fieldref tag.

See Also:
Constant Field Values

CONSTANT_METHODREF

static final int CONSTANT_METHODREF
The CONSTANT_Methodref tag.

See Also:
Constant Field Values

CONSTANT_INTERFACE_METHODREF

static final int CONSTANT_INTERFACE_METHODREF
The CONSTANT_InterfaceMethodref tag.

See Also:
Constant Field Values

CONSTANT_NAME_AND_TYPE

static final int CONSTANT_NAME_AND_TYPE
The CONSTANT_NameAndType tag.

See Also:
Constant Field Values
Method Detail

getLength

int getLength()
Returns the number of entries occupied by this entry in its constant pool.

Returns:
the length this entry in its constant pool

getTag

int getTag()
Returns the tag of this constant pool entry.

Returns:
the tag of this constant pool entry

toString

java.lang.String toString()
Returns a string representation of this constant pool entry.

Overrides:
toString in class java.lang.Object
Returns:
a string representing this constant pool entry