java.lang.annotation
public interface Annotation
Since: 1.5
Method Summary | |
---|---|
Class<? extends Annotation> | annotationType()
Returns the type of this annotation.
|
boolean | equals(Object o) Returns true if the supplied object is equivalent to this annotation. |
int | hashCode() Returns the hash code of the annotation. |
String | toString()
Returns a textual representation of the annotation. |
Returns: the class of which this annotation is an instance.
Returns true if the supplied object is equivalent to this annotation.
For this property to hold, the following must be true of o
:
float
s, then, for floats
x
and y
,
Float.valueOf(x).equals(Float.valueOf(y)
must return
true. This differs from the usual (==
) comparison
in that NaN
is considered equal to itself and positive
and negative zero are seen as different.double
s, then, for doubles
x
and y
,
Double.valueOf(x).equals(Double.valueOf(y)
must return
true. This differs from the usual (==
) comparison
in that NaN
is considered equal to itself and positive
and negative zero are seen as different.equals()
implementation for these
types.Arrays.equals()
==
.Parameters: o the object to compare with this annotation.
Returns: true if the supplied object is an annotation with equivalent members.
Returns the hash code of the annotation. This is computed as the sum of the hash codes of the annotation's members.
The hash code of a member of the annotation is the result of XORing
the hash code of its value with the result of multiplying the hash code
of its name by 127. Formally, if the value is v
and the
name is n
, the hash code of the member is
v.hashCode() XOR (127 * String.hashCode(n)). v.hashCode()
is defined as follows:
byte
,
char
, double
, float
,
int
, long
, short
and
boolean
) is the hash code obtained from its corresponding
wrapper class using valueOf(v).hashCode()
, where
v
is the primitive value.v.hashCode()
.Arrays.hashCode(v)
.Returns: the hash code of the annotation, computed as the sum of its member hashcodes.
Returns: a textual representation of the annotation.