Package org.apache.bcel.classfile
Class Constant
java.lang.Object
org.apache.bcel.classfile.Constant
- All Implemented Interfaces:
Serializable
,Cloneable
,Node
- Direct Known Subclasses:
ConstantClass
,ConstantCP
,ConstantDouble
,ConstantFloat
,ConstantInteger
,ConstantLong
,ConstantNameAndType
,ConstantString
,ConstantUtf8
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 386056 2006-03-15 11:31:56Z tcurdt $
- Author:
- M. Dahm
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.clone()
copy()
abstract void
dump
(DataOutputStream file) boolean
Return value as defined by given BCELComparator strategy.static BCELComparator
final byte
getTag()
int
hashCode()
Return value as defined by given BCELComparator strategy.static void
setComparator
(BCELComparator comparator) toString()
-
Field Details
-
tag
protected byte tag
-
-
Method Details
-
accept
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. -
dump
- Throws:
IOException
-
getTag
public final byte getTag()- Returns:
- Tag of constant, i.e., its type. No setTag() method to avoid confusion.
-
toString
-
copy
- Returns:
- deep copy of this constant
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getComparator
- Returns:
- Comparison strategy object
-
setComparator
- Parameters:
comparator
- Comparison strategy object
-
equals
Return value as defined by given BCELComparator strategy. By default two Constant objects are said to be equal when the result of toString() is equal. -
hashCode
public int hashCode()Return value as defined by given BCELComparator strategy. By default return the hashcode of the result of toString().
-