All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.ClassFile.HField

java.lang.Object
   |
   +----harpoon.ClassFile.HField

public abstract class HField
extends Object
implements HMember
A HField provides information about a single field of a class or an interface. The reflected field may be a class (static) field or an instance field.

Version:
$Id: HField.java,v 1.15 1998/11/10 00:44:38 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
HMember, HClass

Constructor Index

 o HField()

Method Index

 o equals(Object)
Compares this HField against the specified object.
 o getConstant()
Returns the constant value of this HField, if it is a constant field.
 o getDeclaringClass()
Returns the HClass object representing the class or interface that declares the field represented by this HField object.
 o getDescriptor()
Return the type descriptor for this HField object.
 o getModifiers()
Returns the Java language modifiers for the field represented by this HField object, as an integer.
 o getName()
Returns the name of the field represented by this HField object.
 o getType()
Returns an HClass object that identifies the declared type for the field represented by this HField object.
 o hashCode()
Returns a hashcode for this HField.
 o isConstant()
Determines whether this HField represents a constant field.
 o isStatic()
Determines whether this is a static field.
 o isSynthetic()
Determines whether this HField is synthetic.
 o toString()
Return a string describing this HField.

Constructors

 o HField
 public HField()

Methods

 o getDeclaringClass
 public HClass getDeclaringClass()
Returns the HClass object representing the class or interface that declares the field represented by this HField object.

 o getName
 public String getName()
Returns the name of the field represented by this HField object.

 o getModifiers
 public int getModifiers()
Returns the Java language modifiers for the field represented by this HField object, as an integer. The Modifier class should be used to decode the modifiers.

See Also:
Modifier
 o getType
 public HClass getType()
Returns an HClass object that identifies the declared type for the field represented by this HField object.

 o getDescriptor
 public String getDescriptor()
Return the type descriptor for this HField object.

 o getConstant
 public Object getConstant()
Returns the constant value of this HField, if it is a constant field.

Returns:
the wrapped value, or null if !isConstant().
 o isConstant
 public boolean isConstant()
Determines whether this HField represents a constant field.

 o isSynthetic
 public boolean isSynthetic()
Determines whether this HField is synthetic.

 o isStatic
 public boolean isStatic()
Determines whether this is a static field.

 o equals
 public boolean equals(Object object)
Compares this HField against the specified object. Returns true if the objects are the same. Two HFields are the same if they were declared by the same class and have the same name and type.

Overrides:
equals in class Object
 o hashCode
 public int hashCode()
Returns a hashcode for this HField. This is computed as the exclusive-or of the hashcodes for the underlying field's declaring class and the field name.

Overrides:
hashCode in class Object
 o toString
 public String toString()
Return a string describing this HField. The format is the access modifiers for the field, if any, followed by the field type, followed by a space, followed by the fully-qualified name of the class declaring the field, followed by a period, followed by the name of the field. For example:

public static final int java.lang.Thread.MIN_PRIORITY
private int java.io.FileDescriptor.fd

The modifiers are placed in canonical order as specified by "The Java Language Specification." This is public, protected, or private first, and then other modifiers in the following order: static, final, transient, volatile.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index