Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.squawk
Class Field

    java.lang.Object
      com.sun.squawk.Member
          com.sun.squawk.Field

    public final class Field

extends Member

An instance of `Field` encapsulates the information about the field of a class. This includes the name of the field, its type, access flags etc.

Method Summary
`boolean` | `equals(Object other)` Indicates whether some other object is "equal to" this one.
`long` | `getPrimitiveConstantValue()` Gets the primitive constant value of this static field.
`String` | `getStringConstantValue()` Gets the String constant value of this static field.
`Klass` | `getType()` Gets this declared type of this field.
`boolean` | `hasConstant()` Determines if this field had a ConstantValue attribute in its class file definition.
`boolean` | `isTransient()` Determines if this field is transient.

Methods inherited from class com.sun.squawk.Member
`getDefiningClass, getFullyQualifiedName, getModifiers, getName, getOffset, hashCode, isAccessibleFrom, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isSourceSynthetic, isStatic, toString`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Method Detail

### equals

    public boolean equals(Object other)

  Description copied from class: `Object`
  Indicates whether some other object is "equal to" this one.

  The `equals` method implements an equivalence relation:

  - It is reflexive: for any reference value `x`, `x.equals(x)` should return `true`.
  - It is symmetric: for any reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
  - It is transitive: for any reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
  - It is consistent: for any reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the object is modified.
  - For any non-null reference value `x`, `x.equals(null)` should return `false`.

  The `equals` method for class `Object` implements the most discriminating possible equivalence relation on objects; that is, for any reference values `x` and `y`, this method returns `true` if and only if `x` and `y` refer to the same object (`x==y` has the value `true`).

  Overrides:
    `equals` in class `Object`
  Parameters:
    `other` - the reference object with which to compare.
  Returns:
    `true` if this object is the same as the obj argument; `false` otherwise.
  See Also:
    `Boolean.hashCode()`, `Hashtable`

### isTransient

    public boolean isTransient()

  Determines if this field is transient.

  Returns:
    true if this field is transient

### hasConstant

    public boolean hasConstant()

  Determines if this field had a ConstantValue attribute in its class file definition. Note that this does not necessarily mean that the field is 'final'.

  Returns:
    if there is a constant value associated with this field

### getType

    public Klass getType()

  Gets this declared type of this field.

  Returns:
    this declared type of this field

### getStringConstantValue

    public String getStringConstantValue()
                                  throws IllegalArgumentException

  Gets the String constant value of this static field.

  Returns:
    the value derived from the ConstantValue classfile attribute
  Throws:
    `IllegalArgumentException` - if this field did not have a ConstantValue attribute in its class file or if the constant is not a String

### getPrimitiveConstantValue

    public long getPrimitiveConstantValue()
                                   throws IllegalArgumentException

  Gets the primitive constant value of this static field.

  Returns:
    the value derived from the ConstantValue classfile attribute
  Throws:
    `IllegalArgumentException` - if this field did not have a ConstantValue attribute in its class file or if the constant is not a primitive value

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"