com.vladium.jcd.cls.constant
Class CONSTANT_info

java.lang.Object
  extended by com.vladium.jcd.cls.constant.CONSTANT_info
All Implemented Interfaces:
IClassFormatOutput, java.lang.Cloneable
Direct Known Subclasses:
CONSTANT_Class_info, CONSTANT_literal_info, CONSTANT_NameAndType_info, CONSTANT_ref_info, CONSTANT_Utf8_info

public abstract class CONSTANT_info
extends java.lang.Object
implements java.lang.Cloneable, IClassFormatOutput

An abstract base for all other CONSTANT_XXX_info structures. See $4.4 in VM spec 1.0 for all such structure definitions.

Author:
(C) 2001, Vlad Roubtsov

Constructor Summary
protected CONSTANT_info()
           
 
Method Summary
abstract  java.lang.Object accept(ICONSTANTVisitor visitor, java.lang.Object ctx)
           
 java.lang.Object clone()
          Chains to super.clone() and removes CloneNotSupportedException from the method signature.
static CONSTANT_info new_CONSTANT_info(UDataInputStream bytes)
          Virtual constructor method for all CONSTANT_XXX_info structures.
abstract  byte tag()
          Returns the tag byte for this CONSTANT type [this data is static class data].
static java.lang.String tagToString(CONSTANT_info constant)
           
abstract  java.lang.String toString()
           
 int width()
          Returns the number of constant pool index slots occupied by this CONSTANT type.
 void writeInClassFormat(UDataOutputStream out)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CONSTANT_info

protected CONSTANT_info()
Method Detail

tag

public abstract byte tag()
Returns the tag byte for this CONSTANT type [this data is static class data].


accept

public abstract java.lang.Object accept(ICONSTANTVisitor visitor,
                                        java.lang.Object ctx)

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

width

public int width()
Returns the number of constant pool index slots occupied by this CONSTANT type. This implementation defaults to returning '1'.

Returns:
int
See Also:
CONSTANT_Long_info, CONSTANT_Long_info

new_CONSTANT_info

public static CONSTANT_info new_CONSTANT_info(UDataInputStream bytes)
                                       throws java.io.IOException
Virtual constructor method for all CONSTANT_XXX_info structures.

Throws:
java.io.IOException

clone

public java.lang.Object clone()
Chains to super.clone() and removes CloneNotSupportedException from the method signature.

Overrides:
clone in class java.lang.Object

writeInClassFormat

public void writeInClassFormat(UDataOutputStream out)
                        throws java.io.IOException
Specified by:
writeInClassFormat in interface IClassFormatOutput
Throws:
java.io.IOException

tagToString

public static java.lang.String tagToString(CONSTANT_info constant)