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

Field Class Reference

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

Public Methods

 Field (int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)
 Field (Field c)
void accept (Visitor v)
final Field copy (ConstantPool constant_pool)
final ConstantValue getConstantValue ()
final String toString ()
 Field (int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)
 Field (Field c)
void accept (Visitor v)
final Field copy (ConstantPool constant_pool)
final ConstantValue getConstantValue ()
final String toString ()
 Field (String name, Type type, Record record)
void apply (TypeSwitch sw, Object o)
Expr defaultVal ()
boolean equals (Object o)
String getName ()
int getOffset ()
Record getRecord ()
Type getType ()
int hashCode ()
boolean isKind (int kind)
void setOffset (int offset)
String toString ()
 Field (Name name, Type type) throws InvalidNameException
boolean areValidModifiers (int modifiers)
ClassOrInterfaceType getDeclaringClassOrInterface () throws NotDeclaredException
int getModifiers ()
Name getName ()
Type getType ()
boolean isAccessible (ClassOrInterfaceType otherType)
void setDeclaringClassOrInterface (ClassOrInterfaceType declaringClassOrInterface)
void setModifiers (int modifiers) throws InvalidModifiersException
String toString ()

Static Public Methods

boolean areValidClassFieldModifiers (int modifiers)
boolean areValidInterfaceFieldModifiers (int modifiers)
boolean areValidModifiers (int modifiers, boolean isInterface)

Protected Attributes

int modifiers = 0
boolean isArrayLength = false
ArrayType arrayType = null

Private Methods

 Field (DataInputStream file, ConstantPool constant_pool) throws IOException, ClassFormatError
 Field (DataInputStream file, ConstantPool constant_pool) throws IOException, ClassFormatError

Private Attributes

String name
Type type
Record record
int offset
Name name
ClassOrInterfaceType declaringClassOrInterface = null

Detailed Description

This class represents the field info structure, i.e. the representation for a variable in the class. See JVM specification for details.

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

Definition at line 12 of file lib/jpf/de/fub/bytecode/classfile/Field.java.


Constructor & Destructor Documentation

Field::Field int   access_flags,
int   name_index,
int   signature_index,
Attribute   attributes[],
ConstantPool   constant_pool
[inline]
 

Parameters:
access_flags   Access rights of field
name_index   Points to field name in constant pool
signature_index   Points to encoded signature
attributes   Collection of attributes
constant_pool   Array of constants

Definition at line 20 of file lib/jpf/de/fub/bytecode/classfile/Field.java.

Field::Field Field   c [inline]
 

Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Definition at line 29 of file lib/jpf/de/fub/bytecode/classfile/Field.java.

Field::Field DataInputStream   file,
ConstantPool   constant_pool
[inline, private]
 

Construct object from file stream.

Parameters:
file   Input stream

Definition at line 36 of file lib/jpf/de/fub/bytecode/classfile/Field.java.

Field::Field int   access_flags,
int   name_index,
int   signature_index,
Attribute   attributes[],
ConstantPool   constant_pool
[inline]
 

Parameters:
access_flags   Access rights of field
name_index   Points to field name in constant pool
signature_index   Points to encoded signature
attributes   Collection of attributes
constant_pool   Array of constants

Definition at line 21 of file src/de/fub/bytecode/classfile/Field.java.

Field::Field Field   c [inline]
 

Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Definition at line 30 of file src/de/fub/bytecode/classfile/Field.java.

Field::Field DataInputStream   file,
ConstantPool   constant_pool
[inline, private]
 

Construct object from file stream.

Parameters:
file   Input stream

Definition at line 37 of file src/de/fub/bytecode/classfile/Field.java.

Field::Field Name   name,
Type   type
[inline]
 

Parameters:
name   edu.ksu.cis.bandera.jjjc.symboltable.Name
type   edu.ksu.cis.bandera.jjjc.symboltable.Type

Definition at line 50 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.


Member Function Documentation

void Field::accept Visitor   v [inline, virtual]
 

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.

Parameters:
v   Visitor object

Reimplemented from Instruction.

Definition at line 49 of file src/de/fub/bytecode/classfile/Field.java.

void Field::accept Visitor   v [inline, virtual]
 

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.

Parameters:
v   Visitor object

Reimplemented from Instruction.

Definition at line 48 of file lib/jpf/de/fub/bytecode/classfile/Field.java.

boolean Field::areValidClassFieldModifiers int   modifiers [inline, static]
 

Returns:
boolean
Parameters:
modifiers   int

Definition at line 62 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

boolean Field::areValidInterfaceFieldModifiers int   modifiers [inline, static]
 

Returns:
boolean
Parameters:
modifiers   int

Definition at line 76 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

boolean Field::areValidModifiers int   modifiers,
boolean   isInterface
[inline, static]
 

Returns:
boolean
Parameters:
modifiers   int
isInterface   boolean

Definition at line 97 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

boolean Field::areValidModifiers int   modifiers [inline]
 

Returns:
boolean
Parameters:
modifiers   int

Definition at line 88 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

final Field Field::copy ConstantPool   constant_pool [inline]
 

Returns:
deep copy of this field

Definition at line 55 of file src/de/fub/bytecode/classfile/Field.java.

final Field Field::copy ConstantPool   constant_pool [inline]
 

Returns:
deep copy of this field

Definition at line 54 of file lib/jpf/de/fub/bytecode/classfile/Field.java.

boolean Field::equals Object   o [inline]
 

Two fields are equal if they have the same name and type.

Reimplemented from Type.

Definition at line 64 of file src/edu/ksu/cis/bandera/bir/Field.java.

final ConstantValue Field::getConstantValue   [inline]
 

Returns:
constant value associated with this field (may be null)

Definition at line 61 of file src/de/fub/bytecode/classfile/Field.java.

final ConstantValue Field::getConstantValue   [inline]
 

Returns:
constant value associated with this field (may be null)

Definition at line 60 of file lib/jpf/de/fub/bytecode/classfile/Field.java.

ClassOrInterfaceType Field::getDeclaringClassOrInterface   [inline]
 

Returns:
edu.ksu.cis.bandera.jjjc.symboltable.ClassOrInterfaceType

Definition at line 104 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

int Field::getModifiers   [inline]
 

Returns:
int

Definition at line 113 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

Name Field::getName   [inline]
 

Returns:
edu.ksu.cis.bandera.jjjc.symboltable.Name

Reimplemented from FieldOrMethod.

Definition at line 120 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

String Field::getName   [inline]
 

Returns:
Name of object, i.e. method name or field name

Reimplemented from FieldOrMethod.

Definition at line 68 of file src/edu/ksu/cis/bandera/bir/Field.java.

Referenced by FieldGen::FieldGen(), FieldInfo::FieldInfo(), ClassGen::containsField(), ClassInfo::dynamicFieldIndex(), ClassInfo::getDynamicFieldName(), ClassInfo::getStaticFieldName(), and ClassInfo::staticFieldIndex().

Type Field::getType   [inline]
 

Returns:
edu.ksu.cis.bandera.jjjc.symboltable.Type

Reimplemented from Type.

Definition at line 127 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

Type Field::getType   [inline]
 

Returns:
type as defined in Constants

Reimplemented from Type.

Definition at line 71 of file src/edu/ksu/cis/bandera/bir/Field.java.

Referenced by SmvTypeDecl::caseField().

int Field::hashCode   [inline]
 

For storing in a Hashtable.

Returns:
unique hash code for this instruction, assuming labels are unique.

Reimplemented from Instruction.

Definition at line 72 of file src/edu/ksu/cis/bandera/bir/Field.java.

boolean Field::isAccessible ClassOrInterfaceType   otherType [inline]
 

Returns:
boolean
Parameters:
otherType   edu.ksu.cis.bandera.jjjc.symboltable.ClassOrInterfaceType

Definition at line 135 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

void Field::setDeclaringClassOrInterface ClassOrInterfaceType   declaringClassOrInterface [inline]
 

Parameters:
declaringClassOrInterface   edu.ksu.cis.bandera.jjjc.symboltable.ClassOrInterfaceType

Definition at line 156 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

void Field::setModifiers int   modifiers [inline]
 

Parameters:
modifiers   int

Definition at line 163 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

String Field::toString   [inline]
 

Returns:
java.lang.String

Reimplemented from Type.

Definition at line 174 of file src/edu/ksu/cis/bandera/jjjc/symboltable/Field.java.

String Field::toString   [inline]
 

Returns:
Type string, e.g. `int[]'

Reimplemented from Type.

Definition at line 80 of file src/edu/ksu/cis/bandera/bir/Field.java.

final String Field::toString   [inline]
 

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

Returns:
String representation of field, including the signature.

Reimplemented from Type.

Definition at line 74 of file src/de/fub/bytecode/classfile/Field.java.

final String Field::toString   [inline]
 

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

Returns:
String representation of field, including the signature.

Reimplemented from Type.

Definition at line 73 of file lib/jpf/de/fub/bytecode/classfile/Field.java.

Referenced by ClassInfo::loadDynamicFields(), and ClassInfo::loadStaticFields().


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