FieldAPI.javaAPI DocAndroid 1.5 API3173Wed May 06 22:41:22 BST 2009jdiff


public class FieldAPI extends Object implements Comparable
Class to represent a field, analogous to FieldDoc in the Javadoc doclet API. The method used for Collection comparison (compareTo) must make its comparison based upon everything that is known about this field. See the file LICENSE.txt for copyright details.
Matthew Doar,

Fields Summary
public String
Name of the field.
public String
Type of the field.
public String
The fully qualified name of the class or interface this field is inherited from. If this is null, then the field is defined locally in this class or interface.
public boolean
Set if this field is transient.
public boolean
Set if this field is volatile.
public String
If non-null, this is the value of this field.
public Modifiers
Modifiers for this class.
public String
The doc block, default is null.
Constructors Summary
public FieldAPI(String name, String type, boolean isTransient, boolean isVolatile, String value, Modifiers modifiers)

        name_ = name;
        type_ = type;
        isTransient_ = isTransient;
        isVolatile_ = isVolatile;
        value_ = value;
        modifiers_ = modifiers;
public FieldAPI(FieldAPI f)
Copy constructor.

        name_ = f.name_;
        type_ = f.type_;
        inheritedFrom_ = f.inheritedFrom_;
        isTransient_ = f.isTransient_;
        isVolatile_ = f.isVolatile_;
        value_ = f.value_;
        modifiers_ = f.modifiers_; // Note: shallow copy
        doc_ = f.doc_;
Methods Summary
public intcompareTo(java.lang.Object o)
Compare two FieldAPI objects, including name, type and modifiers.

        FieldAPI oFieldAPI = (FieldAPI)o;
        int comp = name_.compareTo(oFieldAPI.name_);
        if (comp != 0)
            return comp;
        comp = type_.compareTo(oFieldAPI.type_);
        if (comp != 0)
            return comp;
        if (APIComparator.changedInheritance(inheritedFrom_, oFieldAPI.inheritedFrom_) != 0)
            return -1;
        if (isTransient_ != oFieldAPI.isTransient_) {
            return -1;
        if (isVolatile_ != oFieldAPI.isVolatile_) {
            return -1;
        if (value_ != null && oFieldAPI.value_ != null) {
            comp = value_.compareTo(oFieldAPI.value_);
            if (comp != 0)
                return comp;
        comp = modifiers_.compareTo(oFieldAPI.modifiers_);
        if (comp != 0)
            return comp;
        if (APIComparator.docChanged(doc_, oFieldAPI.doc_))
            return -1;
        return 0;
public booleanequals(java.lang.Object o)
Tests two fields, using just the field name, used by indexOf().

        if (name_.compareTo(((FieldAPI)o).name_) == 0)
            return true;
        return false;