Package classycle.classfile

# Class RefConstant

java.lang.Object
classycle.classfile.Constant
classycle.classfile.RefConstant

Direct Known Subclasses:
  `FieldRefConstant`, `InterfaceMethodRefConstant`, `MethodRefConstant`

public abstract class RefConstant extends Constant
Abstract supper class of all reference constants.

Author:
  Franz-Josef Elmer

## Constructor Summary

Constructors
Constructor
Description
`RefConstant(Constant[] pool, int classIndex, int nameAndTypeIndex)`
Creates an instance for the specified class, name, and type.

## Method Summary

Modifier and Type
Method
Description
`ClassConstant`
`getClassConstant()`
Returns the class constant.
`NameAndTypeConstant`
`getNameAndType()`
Returns the name-and-type constant.
`protected String`
`toString(String constantType)`
Pretty printing.

### Methods inherited from class classycle.classfile.Constant

`extractConstantPool, getConstant`

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

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

## Constructor Details

### RefConstant

public RefConstant(Constant[] pool, int classIndex, int nameAndTypeIndex)
Creates an instance for the specified class, name, and type.

Parameters:
  `pool` - Constant pool. Needed for resolving references.
  `classIndex` - Index of `ClassConstant`.
  `nameAndTypeIndex` - Index of `NameAndTypeConstant`.

## Method Details

### getClassConstant

public ClassConstant getClassConstant()
Returns the class constant.

### getNameAndType

public NameAndTypeConstant getNameAndType()
Returns the name-and-type constant.

### toString

protected String toString(String constantType)
Pretty printing. Will be used by `toString` of the subclasses.