Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.bcel.classfile
Class ConstantCP  view ConstantCP download ConstantCP.java

java.lang.Object
  extended byorg.apache.bcel.classfile.Constant
      extended byorg.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 386056 2006-03-15 11:31:56Z tcurdt $

Field Summary
protected  int class_index
          References to the constants containing the class and the field signature
protected  int name_and_type_index
          References to the constants containing the class and the field signature
 
Fields inherited from class org.apache.bcel.classfile.Constant
tag
 
Constructor Summary
(package private) ConstantCP(byte tag, java.io.DataInputStream file)
          Initialize instance from file data.
protected ConstantCP(byte tag, int class_index, int name_and_type_index)
           
  ConstantCP(ConstantCP c)
          Initialize from another object.
 
Method Summary
 void dump(java.io.DataOutputStream file)
          Dump constant field reference to file stream in binary format.
 java.lang.String getClass(ConstantPool cp)
           
 int getClassIndex()
           
 int getNameAndTypeIndex()
           
 void setClassIndex(int class_index)
           
 void setNameAndTypeIndex(int name_and_type_index)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class org.apache.bcel.classfile.Constant
accept, clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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

Constructor Detail

ConstantCP

public ConstantCP(ConstantCP c)
Initialize from another object.


ConstantCP

ConstantCP(byte tag,
           java.io.DataInputStream file)
     throws java.io.IOException
Initialize instance from file data.


ConstantCP

protected ConstantCP(byte tag,
                     int class_index,
                     int name_and_type_index)
Method Detail

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:
dump in class Constant

getClassIndex

public final int getClassIndex()

getNameAndTypeIndex

public final int getNameAndTypeIndex()

setClassIndex

public final void setClassIndex(int class_index)

getClass

public java.lang.String getClass(ConstantPool cp)

setNameAndTypeIndex

public final void setNameAndTypeIndex(int name_and_type_index)

toString

public final java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).

Overrides:
toString in class Constant