Class dec.trek.FieldThe Field object allows you to manipulate the fields of a class. This includes both variables and constants. Also a field can be passed as an argument when the methods corresponding parameter is of class Member. This is because Member is the superclass of Field and Method. The Field class does not have a public constructor. To reach a classfiles fields, you must use firstField() or lastField() in the ClassFile class, getMember() in the Instruction class, or override at(Field) in the Trek class. Method Summary
Fieldspublic Object userDefined Field that can be used by an application developer to store arbitrary data about this object during the trek. Methodspublic ClassFile getClassFile() Returns the ClassFile object for this fields class Returns the number of bytes of storage required for this field: byte fields return 1, short and char fields return 2, long and double fields return 8, and all other fields including arrays and objects return 4. public boolean hasModifier(int flags) Returns true if this field was declared with any of the specified access flags. Parameters: flags one or more of the ACC constants defined in the Trek class. Returns true if this field is an array. Returns the Field of the alphabetically next field in this fields classfile. Returns the Field of the alphabetically previous field in this fields classfile.
Returns a persistent value that identifies this field. A reference to this field can be acquired by calling getObject on a trek that this field is within. Returns the source statement that defined this field. Returns the data type of this field, for example int or java.lang.Object. |