jef.dna.attributes
Interface ConstantValueAttribute

All Superinterfaces:
Attribute, BytesCountable, java.lang.Cloneable
All Known Implementing Classes:
ConstantValue

public interface ConstantValueAttribute
extends Attribute

The ConstantValue class represents a ConstantValue Attribute as defined by the JVM Class file Specification: The ConstantValue attribute is a fixed-length attribute used in the attributes table of the field_info structures. A ConstantValue attribute represents the value of a constant field that must be (explicitly or implicitly) static; that is, the ACC_STATIC bit in the flags item of the field_info structure must be set. There can be no more than one ConstantValue attribute in the attributes table of a given field_info structure. The constant field represented by the field_info structure is assigned the value referenced by its ConstantValue attribute as part of the initialization of the class or interface declaring the constant field. This occurs immediately prior to the invocation of the class or interface initialization method of that class or interface.

Author:
Francesco Russo frusso@cs.unibo.it

Method Summary
 int getValue()
          This method gets the constantvalue_index of the current ConstantValueAttribute.
 void setValue(int value)
          This method sets the constantvalue_index of the current ConstantValueAttribute.
 
Methods inherited from interface jef.dna.attributes.Attribute
clone, fromStream, getDna, getLength, getNameIndex, setDna, setNameIndex, toStream, updateRefs, validate
 
Methods inherited from interface jef.dna.util.BytesCountable
getBytesCount
 

Method Detail

setValue

void setValue(int value)
This method sets the constantvalue_index of the current ConstantValueAttribute. The provided index has to be a valid index into the constant pool table. The entry at that index gives the constant value represented by this attribute.

Parameters:
value - A valid index into the constant pool table

getValue

int getValue()
This method gets the constantvalue_index of the current ConstantValueAttribute. This index will be a valid index into the constant pool table. The entry at that index gives the constant value represented by this attribute.

Returns:
int A valid index into the constant pool table