public interface Name
The Name interface represents a generic name -- an ordered sequence of components. It can be a composite name (names that span multiple namespaces), or a compound name (names that are used within individual hierarchical naming systems).
There can be different implementations of Name; for example, composite names, URLs, or namespace-specific compound names.
The components of a name are numbered. The indexes of a name with N components range from 0 up to, but not including, N. This range may be written as [0,N). The most significant component is at index 0. An empty name has no components.
None of the methods in this interface accept null as a valid value for a parameter that is a name or a name component. Likewise, methods that return a name or name component never return null.
An instance of a Name may not be synchronized against concurrent multithreaded access if that access is not read-only.
| Field Summary | |
|---|---|
static long |
serialVersionUID
The class fingerprint that is set to indicate serialization compatibility with a previous version of the class. |
| Method Summary | |
|---|---|
Name |
add(int posn,
String comp)
Adds a single component at a specified position within this name. |
Name |
add(String comp)
Adds a single component to the end of this name. |
Name |
addAll(int posn,
Name n)
Adds the components of a name -- in order -- at a specified position within this name. |
Name |
addAll(Name suffix)
Adds the components of a name -- in order -- to the end of this name. |
Object |
clone()
Generates a new copy of this name. |
int |
compareTo(Object obj)
Compares this name with another name for order. |
boolean |
endsWith(Name n)
Determines whether this name ends with a specified suffix. |
String |
get(int posn)
Retrieves a component of this name. |
Enumeration<String> |
getAll()
Retrieves the components of this name as an enumeration of strings. |
Name |
getPrefix(int posn)
Creates a name whose components consist of a prefix of the components of this name. |
Name |
getSuffix(int posn)
Creates a name whose components consist of a suffix of the components in this name. |
boolean |
isEmpty()
Determines whether this name is empty. |
Object |
remove(int posn)
Removes a component from this name. |
int |
size()
Returns the number of components in this name. |
boolean |
startsWith(Name n)
Determines whether this name starts with a specified prefix. |
| Field Detail |
|---|
static final long serialVersionUID
| Method Detail |
|---|
Object clone()
Object.clone()int compareTo(Object obj)
As with Object.equals(), the notion of ordering for names depends on the class that implements this interface. For example, the ordering may be based on lexicographical ordering of the name components. Specific attributes of the name, such as how it treats case, may affect the ordering. In general, two names of different classes may not be compared.
compareTo in interface Comparable<Object>obj - the non-null object to compare against.
ClassCastException - if obj is not a Name of a
type that may be compared with this nameComparable.compareTo(Object)int size()
boolean isEmpty()
Enumeration<String> getAll()
String get(int posn)
posn - the 0-based index of the component to retrieve.
Must be in the range [0,size()).
ArrayIndexOutOfBoundsException - if posn is outside the specified rangeName getPrefix(int posn)
posn - the 0-based index of the component at which to stop.
Must be in the range [0,size()].
ArrayIndexOutOfBoundsException - if posn is outside the specified rangeName getSuffix(int posn)
posn - the 0-based index of the component at which to start.
Must be in the range [0,size()].
ArrayIndexOutOfBoundsException - if posn is outside the specified rangeboolean startsWith(Name n)
n - the name to check
boolean endsWith(Name n)
n - the name to check
Name addAll(Name suffix) throws InvalidNameException
suffix - the components to add
InvalidNameException - if suffix is not a valid name,
or if the addition of the components would violate the syntax
rules of this nameName addAll(int posn, Name n) throws InvalidNameException
n - the components to addposn - the index in this name at which to add the new
components. Must be in the range [0,size()].
ArrayIndexOutOfBoundsException - if posn is outside the specified range
InvalidNameException - if n is not a valid name,
or if the addition of the components would violate the syntax
rules of this nameName add(String comp) throws InvalidNameException
comp - the component to add
InvalidNameException - if adding comp would violate
the syntax rules of this nameName add(int posn, String comp) throws InvalidNameException
comp - the component to addposn - the index at which to add the new component.
Must be in the range [0,size()].
ArrayIndexOutOfBoundsException - if posn is outside the specified range
InvalidNameException - if adding comp would violate
the syntax rules of this nameObject remove(int posn) throws InvalidNameException
posn - the index of the component to remove.
Must be in the range [0,size()).
ArrayIndexOutOfBoundsException - if posn is outside the specified range
InvalidNameException - if deleting the component
would violate the syntax rules of the nameCes informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
6 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)