Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Constant Class Reference

Inheritance diagram for Constant:
[legend]
Collaboration diagram for Constant:
[legend]
List of all members.

Public Methods

abstract void accept (Visitor v)
Object clone () throws CloneNotSupportedException
Constant copy ()
abstract void dump (DataOutputStream file) throws IOException
final byte getTag ()
String toString ()
abstract boolean equals (Constant c)
List getUseBoxes ()
abstract void accept (Visitor v)
Object clone () throws CloneNotSupportedException
Constant copy ()
abstract void dump (DataOutputStream file) throws IOException
final byte getTag ()
String toString ()
 Constant (String name, int value, Type type)
void apply (Switch sw)
boolean equals (Object o)
Object getDef ()
String getName ()
Type getType ()
int getValue ()
void print ()
String toString ()

Protected Attributes

byte tag

Private Methods

 Constant (byte tag)
 Constant (byte tag)

Static Private Methods

final Constant readConstant (DataInputStream file) throws IOException, ClassFormatError
final Constant readConstant (DataInputStream file) throws IOException, ClassFormatError

Private Attributes

String name
int value
Type type

Detailed Description

Abstract superclass for classes to represent the different constant types in the constant pool of a class file. The classes keep closely to the JVM specification.

Version:
Id:
Constant.java,v 1.1.1.1 2002/01/24 03:44:00 pserver Exp
Author:
M. Dahm
See also:
ConstantClass , ConstantFieldref , ConstantMethodref , ConstantInterfaceMethodref , ConstantString , ConstantInteger , ConstantFloat , ConstantLong , ConstantDouble , ConstantNameAndType , ConstantUtf8

Definition at line 25 of file lib/jpf/de/fub/bytecode/classfile/Constant.java.


Member Function Documentation

abstract void Constant::accept Visitor   v [pure virtual]
 

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v   Visitor object

Reimplemented in ConstantClass, ConstantDouble, ConstantFieldref, ConstantFloat, ConstantInteger, ConstantInterfaceMethodref, ConstantLong, ConstantMethodref, ConstantNameAndType, ConstantString, ConstantUtf8, ConstantClass, ConstantDouble, ConstantFieldref, ConstantFloat, ConstantInteger, ConstantInterfaceMethodref, ConstantLong, ConstantMethodref, ConstantNameAndType, ConstantString, and ConstantUtf8.

abstract void Constant::accept Visitor   v [pure virtual]
 

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters:
v   Visitor object

Reimplemented in ConstantClass, ConstantDouble, ConstantFieldref, ConstantFloat, ConstantInteger, ConstantInterfaceMethodref, ConstantLong, ConstantMethodref, ConstantNameAndType, ConstantString, ConstantUtf8, ConstantClass, ConstantDouble, ConstantFieldref, ConstantFloat, ConstantInteger, ConstantInterfaceMethodref, ConstantLong, ConstantMethodref, ConstantNameAndType, ConstantString, and ConstantUtf8.

Constant Constant::copy   [inline]
 

Returns:
deep copy of this constant

Definition at line 51 of file src/de/fub/bytecode/classfile/Constant.java.

Constant Constant::copy   [inline]
 

Returns:
deep copy of this constant

Definition at line 51 of file lib/jpf/de/fub/bytecode/classfile/Constant.java.

Referenced by ConstantPool::copy().

final byte Constant::getTag   [inline]
 

Returns:
Tag of constant, i.e., its type. No setTag() method to avoid confusion.

Definition at line 63 of file src/de/fub/bytecode/classfile/Constant.java.

final byte Constant::getTag   [inline]
 

Returns:
Tag of constant, i.e. its type. No setTag() method to avoid confusion.

Definition at line 63 of file lib/jpf/de/fub/bytecode/classfile/Constant.java.

Referenced by ConstantCP::ConstantCP(), ConstantPool::ConstantPool(), CodeHTML::codeToHTML(), Utility::codeToString(), ConstantPool::constantToString(), and ConstantPool::getConstant().

final Constant Constant::readConstant DataInputStream   file [inline, static, private]
 

Read one constant from the given file, the type depends on a tag byte.

Parameters:
file   Input stream
Returns:
Constant object

Definition at line 70 of file src/de/fub/bytecode/classfile/Constant.java.

final Constant Constant::readConstant DataInputStream   file [inline, static, private]
 

Read one constant from the given file, the type depends on a tag byte.

Parameters:
file   Input stream
Returns:
Constant object

Definition at line 70 of file lib/jpf/de/fub/bytecode/classfile/Constant.java.

Referenced by ConstantPool::ConstantPool().

String Constant::toString   [inline]
 

Returns:
String representation.

Reimplemented in ConstantClass, ConstantCP, ConstantDouble, ConstantFloat, ConstantInteger, ConstantLong, ConstantNameAndType, ConstantString, ConstantUtf8, ConstantClass, ConstantCP, ConstantDouble, ConstantFloat, ConstantInteger, ConstantLong, ConstantNameAndType, ConstantString, ConstantUtf8, and ChooseExpr.

Definition at line 95 of file src/de/fub/bytecode/classfile/Constant.java.

String Constant::toString   [inline]
 

Returns:
String representation.

Reimplemented in ConstantClass, ConstantCP, ConstantDouble, ConstantFloat, ConstantInteger, ConstantLong, ConstantNameAndType, ConstantString, ConstantUtf8, ConstantClass, ConstantCP, ConstantDouble, ConstantFloat, ConstantInteger, ConstantLong, ConstantNameAndType, ConstantString, ConstantUtf8, and ChooseExpr.

Definition at line 95 of file lib/jpf/de/fub/bytecode/classfile/Constant.java.


The documentation for this class was generated from the following files:
Generated at Thu Feb 7 07:07:02 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001