Class Constant
java.lang.Object
EDU.purdue.cs.bloat.reflect.Constant
A Constant is used to represent an item in the constant pool of a class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteConstant tag for class types.static final byteConstant tag for double constants.static final byteConstant tag for field references.static final byteConstant tag for float constants.static final byteConstant tag for int, short, byte, char, and boolean constants.static final byteConstant tag for method references.static final byteConstant tag for long constants.static final byteConstant tag for method references.static final byteConstant tag for holding the name and type of a field or method.static final byteConstant tag for java.lang.String constants.static final byteConstant tag for holding the a UTF8 format string. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CLASS
public static final byte CLASSConstant tag for class types. This is used to reference other classes, such as the superclass, and is used by the checkcast and instanceof instructions. The Fieldref, Methodref and InterfaceMethodref constant types refer to this constant type.- See Also:
-
FIELD_REF
public static final byte FIELD_REFConstant tag for field references. This is used to reference a field in (possibly) another class. The getfield, putfield, getstatic, and putstatic instructions use this constant type.- See Also:
-
METHOD_REF
public static final byte METHOD_REFConstant tag for method references. This is used to reference a method in (possibly) another class. The invokevirtual, invokespecial, and invokestatic instructions use this constant type.- See Also:
-
STRING
public static final byte STRINGConstant tag for java.lang.String constants. The actual string value is stored indirectly in a Utf8 constant.- See Also:
-
INTEGER
public static final byte INTEGERConstant tag for int, short, byte, char, and boolean constants.- See Also:
-
FLOAT
public static final byte FLOATConstant tag for float constants.- See Also:
-
LONG
public static final byte LONGConstant tag for long constants.- See Also:
-
DOUBLE
public static final byte DOUBLEConstant tag for double constants.- See Also:
-
INTERFACE_METHOD_REF
public static final byte INTERFACE_METHOD_REFConstant tag for method references. This is used to reference a method in an interface. The invokeinterface instruction uses this constant type.- See Also:
-
NAME_AND_TYPE
public static final byte NAME_AND_TYPEConstant tag for holding the name and type of a field or method. The Fieldref, Methodref and InterfaceMethodref constant types refer to this constant type.- See Also:
-
UTF8
public static final byte UTF8Constant tag for holding the a UTF8 format string. The string is used to hold the name and type descriptor for NameandType constants, the class name for Class constants, the string value for String constants.- See Also:
-
-
Constructor Details
-
Constant
- Parameters:
tag- The constant's tag.value- The constant's value.
-
-
Method Details
-
tag
public final int tag()Get the tag of the constant.- Returns:
- The tag.
-
value
-
hashCode
-
equals
-
toString
-