java.lang.Objectjavax.naming.CompoundName
This class represents a compound name -- a name from a hierarchical name space. Each component in a compound name is an atomic name.
The components of a compound name are numbered. The indexes of a compound 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 compound name has no components.
The string form of the compound name follows the syntax described above. When the components of the compound name are turned into their string representation, the reserved syntax rules described above are applied (e.g. embedded separators are escaped or quoted) so that when the same string is parsed, it will yield the same components of the original compound name.
| Field Summary | |
|---|---|
protected javax.naming.NameImpl |
impl
Implementation of this compound name. |
protected Properties |
mySyntax
Syntax properties for this compound name. |
| Constructor Summary | |
|---|---|
protected |
CompoundName(Enumeration<String> comps,
Properties syntax)
Constructs a new compound name instance using the components specified in comps and syntax. |
|
CompoundName(String n,
Properties syntax)
Constructs a new compound name instance by parsing the string n using the syntax specified by the syntax properties supplied. |
| Method Summary | |
|---|---|
Name |
add(int posn,
String comp)
Adds a single component at a specified position within this compound name. |
Name |
add(String comp)
Adds a single component to the end of this compound name. |
Name |
addAll(int posn,
Name n)
Adds the components of a compound name -- in order -- at a specified position within this compound name. |
Name |
addAll(Name suffix)
Adds the components of a compound name -- in order -- to the end of this compound name. |
Object |
clone()
Creates a copy of this compound name. |
int |
compareTo(Object obj)
Compares this CompoundName with the specified Object for order. |
boolean |
endsWith(Name n)
Determines whether a compound name is a suffix of this compound name. |
boolean |
equals(Object obj)
Determines whether obj is syntactically equal to this compound name. |
String |
get(int posn)
Retrieves a component of this compound name. |
Enumeration<String> |
getAll()
Retrieves the components of this compound name as an enumeration of strings. |
Name |
getPrefix(int posn)
Creates a compound name whose components consist of a prefix of the components in this compound name. |
Name |
getSuffix(int posn)
Creates a compound name whose components consist of a suffix of the components in this compound name. |
int |
hashCode()
Computes the hash code of this compound name. |
boolean |
isEmpty()
Determines whether this compound name is empty. |
Object |
remove(int posn)
Deletes a component from this compound name. |
int |
size()
Retrieves the number of components in this compound name. |
boolean |
startsWith(Name n)
Determines whether a compound name is a prefix of this compound name. |
String |
toString()
Generates the string representation of this compound name, using the syntax rules of the compound name. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient javax.naming.NameImpl impl
protected transient Properties mySyntax
| Constructor Detail |
|---|
protected CompoundName(Enumeration<String> comps, Properties syntax)
comps - A non-null enumeration of the components to add.
Each element of the enumeration is of class String.
The enumeration will be consumed to extract its
elements.syntax - A non-null properties that specify the syntax of
this compound name. See class description for
contents of properties.public CompoundName(String n, Properties syntax) throws InvalidNameException
n - The non-null string to parse.syntax - A non-null list of properties that specify the syntax of
this compound name. See class description for
contents of properties.
InvalidNameException - If 'n' violates the syntax specified
by syntax.| Method Detail |
|---|
public String toString()
public boolean equals(Object obj)
Equality is also defined in terms of the syntax of this compound name. The default implementation of CompoundName uses the syntax properties jndi.syntax.ignorecase and jndi.syntax.trimblanks when comparing two components for equality. If case is ignored, two strings with the same sequence of characters but with different cases are considered equal. If blanks are being trimmed, leading and trailing blanks are ignored for the purpose of the comparison.
Both compound names must have the same number of components.
Implementation note: Currently the syntax properties of the two compound names are not compared for equality. They might be in the future.
obj - The possibly null object to compare against.
compareTo(java.lang.Object obj)public int hashCode()
Object.equals(java.lang.Object),
Hashtablepublic Object clone()
Cloneablepublic int compareTo(Object obj)
If obj is null or not an instance of CompoundName, ClassCastException is thrown.
See equals() for what it means for two compound names to be equal. If two compound names are equal, 0 is returned.
Ordering of compound names depend on the syntax of the compound name. By default, they follow lexicographical rules for string comparison with the extension that this applies to all the components in the compound name and that comparison of individual components is affected by the jndi.syntax.ignorecase and jndi.syntax.trimblanks properties, identical to how they affect equals(). If this compound name is "lexicographically" lesser than obj, a negative number is returned. If this compound name is "lexicographically" greater than obj, a positive number is returned.
Implementation note: Currently the syntax properties of the two compound names are not compared when checking order. They might be in the future.
compareTo in interface Comparable<Object>compareTo in interface Nameobj - The non-null object to compare against.
ClassCastException - if obj is not a CompoundName.equals(java.lang.Object)public int size()
public boolean isEmpty()
public Enumeration<String> getAll()
public 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 range.public Name 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 range.public Name 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 range.public boolean startsWith(Name n)
Implementation note: Currently the syntax properties of n are not used when doing the comparison. They might be in the future.
startsWith in interface Namen - The possibly null compound name to check.
public boolean endsWith(Name n)
Implementation note: Currently the syntax properties of n are not used when doing the comparison. They might be in the future.
n - The possibly null compound name to check.
public Name addAll(Name suffix) throws InvalidNameException
Implementation note: Currently the syntax properties of suffix is not used or checked. They might be in the future.
suffix - The non-null components to add.
InvalidNameException - If suffix is not a compound name,
or if the addition of the components violates the syntax
of this compound name (e.g. exceeding number of components).public Name addAll(int posn, Name n) throws InvalidNameException
Implementation note: Currently the syntax properties of suffix is not used or checked. They might be in the future.
n - The non-null components to add.posn - 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 compound name,
or if the addition of the components violates the syntax
of this compound name (e.g. exceeding number of components).public Name add(String comp) throws InvalidNameException
comp - The non-null component to add.
InvalidNameException - If adding comp at end of the name
would violate the compound name's syntax.public Name add(int posn, String comp) throws InvalidNameException
comp - The non-null component to add.posn - 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 at the specified position
would violate the compound name's syntax.public Object remove(int posn) throws InvalidNameException
posn - The index of the component to delete.
Must be in the range [0,size()).
ArrayIndexOutOfBoundsException - If posn is outside the specified range (includes case where
compound name is empty).
InvalidNameException - If deleting the component
would violate the compound name's syntax.Ces 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.
8 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)