Class ConstantPoolEntry
java.lang.Object
org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
org.apache.commons.compress.harmony.unpack200.bytecode.ConstantPoolEntry
- Direct Known Subclasses:
CPClass,CPConstant,CPFieldRef,CPNameAndType,CPRef,CPUTF8
Abstracts constant pool entries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteThe constant 0x7 for a constant pool class.static final byteThe constant 0x6 for a constant pool double.static final byteThe constant 0x9 for a constant pool field reference.static final byteThe constant 0x4 for a constant pool float.static final byteThe constant 0x3 for a constant pool int.static final byteThe constant 0xb for a constant pool interface method reference.static final byteThe constant 0x5 for a constant pool long.static final byteThe constant 0xa for a constant pool method reference.static final byteThe constant 0xc for a constant pool name and type.static final byteThe constant 0x8 for a constant pool string.static final byteThe constant 0x1 for a constant pool UTF8.protected intGlobal index.(package private) byteOne-byte tag indicates the kind of constant.Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoWrite(DataOutputStream dos) Writes this instance to the output stream.abstract booleanintGets the global index.bytegetTag()Gets the tag.abstract inthashCode()protected abstract voidWrites this instance to the given output stream.Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
getNestedClassFileEntries, objectHashCode, resolve, toString, write
-
Field Details
-
CP_Class
public static final byte CP_ClassThe constant 0x7 for a constant pool class.- See Also:
-
CP_Double
public static final byte CP_DoubleThe constant 0x6 for a constant pool double.- See Also:
-
CP_Fieldref
public static final byte CP_FieldrefThe constant 0x9 for a constant pool field reference.- See Also:
-
CP_Float
public static final byte CP_FloatThe constant 0x4 for a constant pool float.- See Also:
-
CP_Integer
public static final byte CP_IntegerThe constant 0x3 for a constant pool int.- See Also:
-
CP_InterfaceMethodref
public static final byte CP_InterfaceMethodrefThe constant 0xb for a constant pool interface method reference.- See Also:
-
CP_Long
public static final byte CP_LongThe constant 0x5 for a constant pool long.- See Also:
-
CP_Methodref
public static final byte CP_MethodrefThe constant 0xa for a constant pool method reference.- See Also:
-
CP_NameAndType
public static final byte CP_NameAndTypeThe constant 0xc for a constant pool name and type.- See Also:
-
CP_String
public static final byte CP_StringThe constant 0x8 for a constant pool string.- See Also:
-
CP_UTF8
public static final byte CP_UTF8The constant 0x1 for a constant pool UTF8.- See Also:
-
tag
byte tagOne-byte tag indicates the kind of constant. -
globalIndex
protected int globalIndexGlobal index.
-
-
Constructor Details
-
ConstantPoolEntry
ConstantPoolEntry(byte tag, int globalIndex) Constructs a new instance.- Parameters:
tag- One-byte tag indicates the kind of constant.globalIndex- Global index.
-
-
Method Details
-
doWrite
Description copied from class:ClassFileEntryWrites this instance to the output stream.- Specified by:
doWritein classClassFileEntry- Parameters:
dos- the output stream.- Throws:
IOException- if an I/O error occurs.
-
equals
- Specified by:
equalsin classClassFileEntry
-
getGlobalIndex
public int getGlobalIndex()Gets the global index.- Returns:
- the global index.
-
getTag
public byte getTag()Gets the tag.- Returns:
- the tag.
-
hashCode
public abstract int hashCode()- Specified by:
hashCodein classClassFileEntry
-
writeBody
Writes this instance to the given output stream.- Parameters:
dos- the output stream.- Throws:
IOException- if an I/O error occurs.
-