org.apache.bcel.classfile
Class ConstantCP
java.lang.Object
  |
  +--org.apache.bcel.classfile.Constant
        |
        +--org.apache.bcel.classfile.ConstantCP
- All Implemented Interfaces: 
- java.lang.Cloneable, Node, java.io.Serializable
- Direct Known Subclasses: 
- ConstantFieldref, ConstantInterfaceMethodref, ConstantMethodref
- public abstract class ConstantCP- extends Constant
Abstract super class for Fieldref and Methodref constants.
- Version:
- $Id: ConstantCP.java,v 1.2 2002/03/11 16:16:35 mdahm Exp $
- Author:
- M. Dahm
- See Also:
- ConstantFieldref,- ConstantMethodref,- ConstantInterfaceMethodref, 
Serialized Form
| Field Summary | 
| protected  int | class_indexReferences to the constants containing the class and the field signature
 | 
| protected  int | name_and_type_indexReferences to the constants containing the class and the field signature
 | 
 
| Fields inherited from class org.apache.bcel.classfile.Constant | 
| tag | 
 
 
 
 
| Methods inherited from class java.lang.Object | 
| equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
 
class_index
protected int class_index
- References to the constants containing the class and the field signature
 
 
name_and_type_index
protected int name_and_type_index
- References to the constants containing the class and the field signature
 
 
ConstantCP
public ConstantCP(ConstantCP c)
- Initialize from another object.
 
ConstantCP
protected ConstantCP(byte tag,
                     int class_index,
                     int name_and_type_index)
- Parameters:
- class_index- Reference to the class containing the field
- name_and_type_index- and the field signature
dump
public final void dump(java.io.DataOutputStream file)
                throws java.io.IOException
- Dump constant field reference to file stream in binary format.
 
- 
- Specified by:
- dumpin class- Constant
 
- 
- Parameters:
- file- Output file stream
- Throws:
- java.io.IOException
 
getClassIndex
public final int getClassIndex()
- 
- Returns:
- Reference (index) to class this field or method belongs to.
 
getNameAndTypeIndex
public final int getNameAndTypeIndex()
- 
- Returns:
- Reference (index) to signature of the field.
 
setClassIndex
public final void setClassIndex(int class_index)
- 
- Parameters:
- class_index- points to Constant_class
 
getClass
public java.lang.String getClass(ConstantPool cp)
- 
- Returns:
- Class this field belongs to.
 
setNameAndTypeIndex
public final void setNameAndTypeIndex(int name_and_type_index)
- 
- Parameters:
- name_and_type_index- points to Constant_NameAndType
 
toString
public final java.lang.String toString()
- 
- Overrides:
- toStringin class- Constant
 
- 
- Returns:
- String representation.
 
Copyright © 2002-2003 Apache Software Foundation. All Rights Reserved.