Package serp.bytecode.lowlevel

# Class Entry

java.lang.Object
serp.bytecode.lowlevel.Entry

All Implemented Interfaces:
  `VisitAcceptor`

Direct Known Subclasses:
  `ClassEntry`, `ComplexEntry`, `DoubleEntry`, `FloatEntry`, `IntEntry`, `InvokeDynamicEntry`, `LongEntry`, `MethodHandleEntry`, `MethodTypeEntry`, `NameAndTypeEntry`, `StringEntry`, `UTF8Entry`

public abstract class Entry extends Object implements VisitAcceptor
Base type for all constant pool entries. Entries should generally be considered immutable; modifying an entry directly can have dire consequences, and often renders the resulting class file invalid.

Entries cannot be shared among constant pools.

Author:
  Abe White

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`CLASS`
`static final int`
`DOUBLE`
`static final int`
`FIELD`
`static final int`
`FLOAT`
`static final int`
`INT`
`static final int`
`INTERFACEMETHOD`
`static final int`
`INVOKEDYNAMIC`
`static final int`
`LONG`
`static final int`
`METHOD`
`static final int`
`METHODHANDLE`
`static final int`
`METHODTYPE`
`static final int`
`NAMEANDTYPE`
`static final int`
`STRING`
`static final int`
`UTF8`

## Constructor Summary

Constructors
Constructor
Description
`Entry()`

## Method Summary

Modifier and Type
Method
Description
`static Entry`
`create(int type)`
Create an entry based on its type code.
`int`
`getIndex()`
Returns the index of the entry in the owning constant pool, or 0.
`ConstantPool`
`getPool()`
Returns the constant pool containing this entry, or null if none.
`abstract int`
`getType()`
Return the type code for this entry type.
`boolean`
`isWide()`
Return true if this is a wide entry -- i.e.
`static Entry`
`read(DataInput in)`
Read a single entry from the given bytecode stream and returns it.
`static void`
`write(Entry entry, DataOutput out)`
Write the given entry to the given bytecode stream.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface serp.bytecode.visitor.VisitAcceptor

`acceptVisit`

## Field Details

### UTF8

public static final int UTF8

See Also:
  - Constant Field Values

### INT

public static final int INT

See Also:
  - Constant Field Values

### FLOAT

public static final int FLOAT

See Also:
  - Constant Field Values

### LONG

public static final int LONG

See Also:
  - Constant Field Values

### DOUBLE

public static final int DOUBLE

See Also:
  - Constant Field Values

### CLASS

public static final int CLASS

See Also:
  - Constant Field Values

### STRING

public static final int STRING

See Also:
  - Constant Field Values

### FIELD

public static final int FIELD

See Also:
  - Constant Field Values

### METHOD

public static final int METHOD

See Also:
  - Constant Field Values

### INTERFACEMETHOD

public static final int INTERFACEMETHOD

See Also:
  - Constant Field Values

### NAMEANDTYPE

public static final int NAMEANDTYPE

See Also:
  - Constant Field Values

### METHODHANDLE

public static final int METHODHANDLE

See Also:
  - Constant Field Values

### METHODTYPE

public static final int METHODTYPE

See Also:
  - Constant Field Values

### INVOKEDYNAMIC

public static final int INVOKEDYNAMIC

See Also:
  - Constant Field Values

## Constructor Details

### Entry

public Entry()

## Method Details

### read

public static Entry read(DataInput in) throws IOException
Read a single entry from the given bytecode stream and returns it.

Throws:
  `IOException`

### write

public static void write(Entry entry, DataOutput out) throws IOException
Write the given entry to the given bytecode stream.

Throws:
  `IOException`

### create

public static Entry create(int type)
Create an entry based on its type code.

### getType

public abstract int getType()
Return the type code for this entry type.

### isWide

public boolean isWide()
Return true if this is a wide entry -- i.e. if it takes up two places in the constant pool. Returns false by default.

### getPool

public ConstantPool getPool()
Returns the constant pool containing this entry, or null if none.

### getIndex

public int getIndex()
Returns the index of the entry in the owning constant pool, or 0.