Class ConstantValue
java.lang.Object
EDU.purdue.cs.bloat.file.Attribute
EDU.purdue.cs.bloat.file.ConstantValue
The ConstantValue attribute stores an index into the constant pool that
represents constant value. A class's static fields have constant value
attributes.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()intReturns the index into the constant pool of the constant value.voidsetConstantValueIndex(int index) Set the index into the constant pool of the constant value.toString()Converts the attribute to a string.voidWrite the attribute to a data stream.
-
Constructor Details
-
ConstantValue
Constructor. Create a ConstantValue attribute from a data stream.- Parameters:
in- The data stream of the class file.nameIndex- The index into the constant pool of the name of the attribute.length- The length of the attribute, excluding the header.- Throws:
IOException- If an error occurs while reading.
-
-
Method Details
-
writeData
Write the attribute to a data stream.- Specified by:
writeDatain classAttribute- Parameters:
out- The data stream of the class file.- Throws:
IOException
-
constantValueIndex
public int constantValueIndex()Returns the index into the constant pool of the constant value. -
setConstantValueIndex
public void setConstantValueIndex(int index) Set the index into the constant pool of the constant value. -
clone
-
toString
-