IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
 
[Sommaire]  [Top 50]  [F.A.Q.]  [ Java SE ]  [ Java EE ]  [Javadoc standard]  [Contact]
[ 1.4.2 ]  [ 5.0 ]  [ 6.0
Rechercher   
Dans
Options   sensible à la casse
étendre la recherche aux descriptions
Préférences
fr en 
 
Moteurs de recherche
JavaTM 2 Platform Std. Ed. v1.6.0

javax.lang.model.element
Interface Name

All Superinterfaces:
CharSequence

public interface Name
extends CharSequence

An immutable sequence of characters. When created by the same implementation, objects implementing this interface must obey the general equals contract when compared with each other. Therefore, Name objects from the same implementation are usable in collections while Names from different implementations may not work properly in collections.

An empty Name has a length of zero.

In the context of annotation processing, the guarantees for "the same" implementation must include contexts where the API mediated side effects of processors could be visible to each other, including successive annotation processing rounds.

Since:
1.6
See Also:
Elements.getName(java.lang.CharSequence)

Method Summary
 boolean contentEquals(CharSequence cs)
          Compares this name to the specified CharSequence.
 boolean equals(Object obj)
          Returns true if the argument represents the same name as this, and false otherwise.
 int hashCode()
          Obeys the general contract of Object.hashCode.
 
Methods inherited from interface java.lang.CharSequence
charAt, length, subSequence, toString
 

Method Detail

equals

boolean equals(Object obj)
Returns true if the argument represents the same name as this, and false otherwise.

Note that the identity of a Name is a function both of its content in terms of a sequence of characters as well as the implementation which created it.

Overrides:
equals in class Object
Parameters:
obj - the object to be compared with this element
Returns:
true if the specified object represents the same name as this
See Also:
Element.equals(java.lang.Object)

hashCode

int hashCode()
Obeys the general contract of Object.hashCode.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
equals(java.lang.Object)

contentEquals

boolean contentEquals(CharSequence cs)
Compares this name to the specified CharSequence. The result is true if and only if this name represents the same sequence of char values as the specified sequence.

Parameters:
cs - The sequence to compare this name against
Returns:
true if this name represents the same sequence of char values as the specified sequence, false otherwise
See Also:
String.contentEquals(CharSequence)

Copyright 2003 Sun Microsystems, Inc. All rights reserved