Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

FieldGen Class Reference

Inheritance diagram for FieldGen:
[legend]
Collaboration diagram for FieldGen:
[legend]
List of all members.

Public Methods

 FieldGen (int access_flags, Type type, String name, ConstantPoolGen cp)
 FieldGen (Field field, ConstantPoolGen cp)
void addAttribute (Attribute attr)
Attribute[] getAttributes ()
ConstantPoolGen getConstantPool ()
Field getField ()
String getName ()
String getSignature ()
Type getType ()
void setConstantPool (ConstantPoolGen cp)
void setInitValue (byte b)
void setInitValue (char c)
void setInitValue (double d)
void setInitValue (float f)
void setInitValue (int i)
void setInitValue (long l)
void setInitValue (String str)
void setInitValue (short s)
void setInitValue (boolean b)
void setName (String name)
void setType (Type type)
 FieldGen (int access_flags, Type type, String name, ConstantPoolGen cp)
 FieldGen (Field field, ConstantPoolGen cp)
void addObserver (FieldObserver o)
void cancelInitValue ()
Field getField ()
String getInitValue ()
String getSignature ()
void removeObserver (FieldObserver o)
void setInitValue (byte b)
void setInitValue (char c)
void setInitValue (double d)
void setInitValue (float f)
void setInitValue (int i)
void setInitValue (long l)
void setInitValue (String str)
void setInitValue (short s)
void setInitValue (boolean b)
final String toString ()
void update ()

Private Methods

void checkType (Type atype)

Private Attributes

Type type
String name
ConstantPoolGen cp
int index = -1
Vector attributes
Vector observers

Detailed Description

Template class for building up a field. The only reasonable thing one can do is a constant value attribute to a field which must of course be compatible with to the declared type.

Version:
Id:
FieldGen.java,v 1.1.1.1 2002/01/24 03:44:03 pserver Exp
Author:
M. Dahm
See also:
Field

Definition at line 16 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.


Constructor & Destructor Documentation

FieldGen::FieldGen int   access_flags,
Type   type,
String   name,
ConstantPoolGen   cp
[inline]
 

Declare a field. If it is a static field (access_flags & ACC_STATIC != 0) it may have an initial value associated with it as defined by setInitValue().

Parameters:
access_flags   access qualifiers
type   field type
name   field name
cp   constant pool

Definition at line 32 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.

FieldGen::FieldGen int   access_flags,
Type   type,
String   name,
ConstantPoolGen   cp
[inline]
 

Declare a field. If it is static (isStatic() == true) and has a basic type like int or String it may have an initial value associated with it as defined by setInitValue().

Parameters:
access_flags   access qualifiers
type   field type
name   field name
cp   constant pool

Definition at line 33 of file src/de/fub/bytecode/generic/FieldGen.java.

FieldGen::FieldGen Field   field,
ConstantPoolGen   cp
[inline]
 

Instantiate from existing method.

Parameters:
field   Field object
cp   constant pool (must contain the same entries as the field's constant pool)

Definition at line 45 of file src/de/fub/bytecode/generic/FieldGen.java.


Member Function Documentation

void FieldGen::addAttribute Attribute   attr [inline]
 

Add an attribute to this method. Currently, the JVM knows about the `Code', `ConstantValue', `Synthetic' and `Exceptions' attributes. Other attributes will be ignored by the JVM but do no harm.

Parameters:
a   attribute to be added

Reimplemented from FieldGenOrMethodGen.

Definition at line 41 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.

void FieldGen::addObserver FieldObserver   o [inline]
 

Add observer for this object.

Definition at line 59 of file src/de/fub/bytecode/generic/FieldGen.java.

void FieldGen::cancelInitValue   [inline]
 

Remove any initial value.

Definition at line 67 of file src/de/fub/bytecode/generic/FieldGen.java.

Attribute [] FieldGen::getAttributes   [inline]
 

Returns:
all attributes of this method.

Reimplemented from FieldGenOrMethodGen.

Definition at line 47 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.

Field FieldGen::getField   [inline]
 

Get field object after having set up all necessary values.

Definition at line 83 of file src/de/fub/bytecode/generic/FieldGen.java.

Field FieldGen::getField   [inline]
 

Get method object.

Definition at line 59 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.

String FieldGen::getName   [inline]
 

Returns:
name of method/field.

Reimplemented from FieldGenOrMethodGen.

Definition at line 74 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.

String FieldGen::getSignature   [inline, virtual]
 

Returns:
signature of method/field.

Reimplemented from FieldGenOrMethodGen.

Definition at line 104 of file src/de/fub/bytecode/generic/FieldGen.java.

String FieldGen::getSignature   [inline, virtual]
 

Returns:
signature of method/field.

Reimplemented from FieldGenOrMethodGen.

Definition at line 75 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.

void FieldGen::removeObserver FieldObserver   o [inline]
 

Remove observer for this object.

Definition at line 107 of file src/de/fub/bytecode/generic/FieldGen.java.

void FieldGen::setInitValue String   str [inline]
 

Set (optional) initial value of field, otherwise it will be set to null/0/false by the JVM automatically.

Definition at line 151 of file src/de/fub/bytecode/generic/FieldGen.java.

void FieldGen::setInitValue String   str [inline]
 

Set (optional) initial value of field, otherwise it will be set to null/0/false by the JVM automatically.

Definition at line 88 of file lib/jpf/de/fub/bytecode/generic/FieldGen.java.

final String FieldGen::toString   [inline]
 

Return string representation close to declaration format, `public static final short MAX = 100', e.g..

Returns:
String representation of field

Definition at line 175 of file src/de/fub/bytecode/generic/FieldGen.java.

void FieldGen::update   [inline]
 

Call notify() method on all observers. This method is not called automatically whenever the state has changed, but has to be called by the user after he has finished editing the object.

Definition at line 195 of file src/de/fub/bytecode/generic/FieldGen.java.


The documentation for this class was generated from the following files:
Generated at Thu Feb 7 07:11:19 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001