de.fub.bytecode.classfile
Class Constant
java.lang.Object
|
+--de.fub.bytecode.classfile.Constant
- Direct Known Subclasses:
- ConstantClass, ConstantCP, ConstantDouble, ConstantFloat, ConstantInteger, ConstantLong, ConstantNameAndType, ConstantString, ConstantUtf8
- public abstract class Constant
- extends java.lang.Object
- implements Constants, java.lang.Cloneable
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.4 1999/05/04 13:12:00 dahm Exp $
- Author:
- M. Dahm
- See Also:
ConstantClass
,
ConstantFieldref
,
ConstantMethodref
,
ConstantInterfaceMethodref
,
ConstantString
,
ConstantInteger
,
ConstantFloat
,
ConstantLong
,
ConstantDouble
,
ConstantNameAndType
,
ConstantUtf8
Field Summary |
protected byte |
tag
|
Method Summary |
abstract void |
accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. |
Constant |
copy()
|
abstract void |
dump(java.io.DataOutputStream file)
|
byte |
getTag()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
tag
protected byte tag
accept
public abstract void accept(Visitor v)
- 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
dump
public abstract void dump(java.io.DataOutputStream file)
throws java.io.IOException
getTag
public final byte getTag()
- Returns:
- Tag of constant, i.e. its type. No setTag() method to avoid
confusion.
toString
public java.lang.String toString()
- Returns:
- String representation.
- Overrides:
- toString in class java.lang.Object
copy
public Constant copy()
- Returns:
- deep copy of this constant