java.lang.annotation
Interface Annotation

All Known Implementing Classes:
Deprecated, Documented, Inherited, Override, Retention, SuppressWarnings, Target

public interface Annotation

The common interface extended by all annotation types. Note that an interface that manually extends this one does not define an annotation type. Also note that this interface does not itself define an annotation type.

Since:
1.5

Method Summary
 Class sample code for java.lang.Class definition code for java.lang.Class <? extends Annotation sample code for java.lang.annotation.Annotation definition code for java.lang.annotation.Annotation > annotationType sample code for java.lang.annotation.Annotation.annotationType() definition code for java.lang.annotation.Annotation.annotationType() ()
          Returns the annotation type of this annotation.
 boolean equals sample code for java.lang.annotation.Annotation.equals(java.lang.Object) definition code for java.lang.annotation.Annotation.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Returns true if the specified object represents an annotation that is logically equivalent to this one.
 int hashCode sample code for java.lang.annotation.Annotation.hashCode() definition code for java.lang.annotation.Annotation.hashCode() ()
          Returns the hash code of this annotation, as defined below:
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.lang.annotation.Annotation.toString() definition code for java.lang.annotation.Annotation.toString() ()
          Returns a string representation of this annotation.
 

Method Detail

equals sample code for java.lang.annotation.Annotation.equals(java.lang.Object) definition code for java.lang.annotation.Annotation.equals(java.lang.Object)

boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Returns true if the specified object represents an annotation that is logically equivalent to this one. In other words, returns true if the specified object is an instance of the same annotation type as this instance, all of whose members are equal to the corresponding member of this annotation, as defined below:

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if the specified object represents an annotation that is logically equivalent to this one, otherwise false
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for java.lang.annotation.Annotation.hashCode() definition code for java.lang.annotation.Annotation.hashCode()

int hashCode()
Returns the hash code of this annotation, as defined below:

The hash code of an annotation is the sum of the hash codes of its members (including those with default values), as defined below: The hash code of an annotation member is (127 times the hash code of the member-name as computed by String.hashCode() sample code for java.lang.String.hashCode() definition code for java.lang.String.hashCode() ) XOR the hash code of the member-value, as defined below:

The hash code of a member-value depends on its type:

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
the hash code of this annotation
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for java.lang.annotation.Annotation.toString() definition code for java.lang.annotation.Annotation.toString()

String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string representation of this annotation. The details of the representation are implementation-dependent, but the following may be regarded as typical:
   @com.acme.util.Name(first=Alfred, middle=E., last=Neuman)
 

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a string representation of this annotation

annotationType sample code for java.lang.annotation.Annotation.annotationType() definition code for java.lang.annotation.Annotation.annotationType()

Class sample code for java.lang.Class definition code for java.lang.Class <? extends Annotation sample code for java.lang.annotation.Annotation definition code for java.lang.annotation.Annotation > annotationType()
Returns the annotation type of this annotation.