"

2013 FRC Java API

"

com.sun.squawk
Class Field

java.lang.Object
  extended by com.sun.squawk.Member
      extended by 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:

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

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"