|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Annotation
This is the common interface for all annotations. Note that classes that implement this class manually are not classed as annotations, and that this interface does not define an annotation type in itself.
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. |
Method Detail |
---|
Class<? extends Annotation> annotationType()
boolean equals(Object o)
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()
==
.
equals
in class Object
o
- the object to compare with this annotation.
Object.hashCode()
int hashCode()
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)
.
hashCode
in class Object
Object.equals(Object)
,
System.identityHashCode(Object)
String toString()
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |