java.lang.annotation.Annotation |
Known Indirect Subclasses
Deprecated |
Annotation type used to mark program elements that should no longer be used
by programmers. |
Documented |
Defines a meta-annotation for indicating that an annotation is documented and
considered part of the public API. |
FlakyTest |
This annotation can be used on an InstrumentationTestCase 's
test methods. |
Inherited |
Defines a meta-annotation for indicating that an annotation is automatically
inherited. |
LargeTest |
Marks a test that should run as part of the large tests. |
MediumTest |
Marks a test that should run as part of the medium tests. |
Override |
Annotation type used to mark methods that override a method declaration in a
superclass. |
RemoteViews.RemoteView |
This annotation indicates that a subclass of View is alllowed to be used
with the RemoteViews mechanism. |
Retention |
Defines a meta-annotation for determining the scope of retention for an
annotation. |
SmallTest |
Marks a test that should run as part of the small tests. |
Smoke |
Marks a test that should run as part of the smoke tests. |
Suppress |
Use this annotation on test classes or test methods that should not be included in a test
suite. |
SuppressLint |
Indicates that Lint should ignore the specified warnings for the annotated element. |
SuppressWarnings |
Annotation type used to indicate that the compiler should not issue the
specified warnings for the marked program element. |
Target |
Defines a meta-annotation for determining what ElementType s an
annotation can be applied to. |
TargetApi |
Indicates that Lint should treat this type as targeting a given API level, no matter what the
project target is. |
TestTarget |
This @interface is deprecated.
Obsolete
|
TestTargetClass |
This @interface is deprecated.
Obsolete
|
UiThreadTest |
This annotation can be used on an InstrumentationTestCase 's test methods. |
ViewDebug.CapturedViewProperty |
This annotation can be used to mark fields and methods to be dumped when
the view is captured. |
ViewDebug.ExportedProperty |
This annotation can be used to mark fields and methods to be dumped by
the view server. |
ViewDebug.FlagToString |
Defines a mapping from a flag to a String. |
ViewDebug.IntToString |
Defines a mapping from an int value to a String. |
|
Class Overview
Defines the interface implemented by all annotations. Note that the interface
itself is not an annotation, and neither is an interface that simply
extends this one. Only the compiler is able to create proper annotation
types.
Summary
Public Methods |
abstract
Class<? extends Annotation>
|
annotationType()
Returns the type of this annotation.
|
abstract
boolean
|
equals(Object obj)
Determines whether or not this annotation is equivalent to the annotation
passed.
|
abstract
int
|
hashCode()
Returns the hash code of this annotation.
|
abstract
String
|
toString()
Returns a String representation of this annotation.
|
Public Methods
public
abstract
Class<? extends Annotation>
annotationType
()
Returns the type of this annotation.
Returns
- A
Class
instance representing the annotation type.
public
abstract
boolean
equals
(Object obj)
Determines whether or not this annotation is equivalent to the annotation
passed. This is determined according to the following rules:
-
Two annotations
x
and y
are equal if and only if
they are members of the same annotation type and all the member
values of x
are equal to the corresponding member values
of y
.
-
The equality of primitive member values
x
and y
is determined (in a way similar to) using the corresponding
wrapper classes. For example,
Integer.valueOf(x).equals(Integer.valueOf(y)
is used for
int
values. Note: The behavior is identical to the
==
operator for all but the floating point type, so the
implementation may as well use ==
in these cases for
performance reasons. Only for the float
and double
types the result will be slightly different: NaN
is equal
to NaN
, and -0.0
is equal to 0.0
, both of
which is normally not the case.
-
The equality of two array member values
x
and y
is determined using the corresponding equals(x, y)
helper function in Arrays
.
-
The hash code for all other member values is determined by simply
calling their
equals()
method.
Parameters
obj
| The object to compare to. |
Returns
true
if obj
is equal to this annotation,
false
otherwise.
public
abstract
int
hashCode
()
Returns the hash code of this annotation. The hash code is determined
according to the following rules:
-
The hash code of an annotation is the sum of the hash codes of
its annotation members.
-
The hash code of an annotation member is calculated as
(0x7f * n.hashCode()) ^ v.hashCode())
, where n
is the
name of the member (as a String
) and v
its value.
-
The hash code for a primitive member value is determined using
the corresponding wrapper type. For example,
Integer.valueOf(v).hashCode()
is used for an int
value
v
.
-
The hash code for an array member value
v
is determined
using the corresponding hashCode(v)
helper function in
Arrays
.
-
The hash code for all other member values is determined by simply
calling their
hashCode
method.
public
abstract
String
toString
()
Returns a String
representation of this annotation. It is not
strictly defined what the representation has to look like, but it usually
consists of the name of the annotation, preceded by a "@". If the
annotation contains field members, their names and values are also
included in the result.
Returns
- the
String
that represents this annotation.