java.lang.Objectjavax.naming.directory.BasicAttributes
public class BasicAttributes
This class provides a basic implementation of the Attributes interface.
BasicAttributes is either case-sensitive or case-insensitive (case-ignore). This property is determined at the time the BasicAttributes constructor is called. In a case-insensitive BasicAttributes, the case of its attribute identifiers is ignored when searching for an attribute, or adding attributes. In a case-sensitive BasicAttributes, the case is significant.
When the BasicAttributes class needs to create an Attribute, it uses BasicAttribute. There is no other dependency on BasicAttribute.
Note that updates to BasicAttributes (such as adding or removing an attribute) does not affect the corresponding representation in the directory. Updates to the directory can only be effected using operations in the DirContext interface.
A BasicAttributes instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single BasicAttributes instance should lock the object.
DirContext.getAttributes(javax.naming.Name),
DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes),
DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes),
DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes),
DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes),
DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]),
Serialized Form| Constructor Summary | |
|---|---|
BasicAttributes()
Constructs a new instance of Attributes. |
|
BasicAttributes(boolean ignoreCase)
Constructs a new instance of Attributes. |
|
BasicAttributes(String attrID,
Object val)
Constructs a new instance of Attributes with one attribute. |
|
BasicAttributes(String attrID,
Object val,
boolean ignoreCase)
Constructs a new instance of Attributes with one attribute. |
|
| Method Summary | |
|---|---|
Object |
clone()
Creates and returns a copy of this object. |
boolean |
equals(Object obj)
Determines whether this BasicAttributes is equal to another Attributes Two Attributes are equal if they are both instances of Attributes, treat the case of attribute IDs the same way, and contain the same attributes. |
Attribute |
get(String attrID)
Retrieves the attribute with the given attribute id from the attribute set. |
NamingEnumeration<Attribute> |
getAll()
Retrieves an enumeration of the attributes in the attribute set. |
NamingEnumeration<String> |
getIDs()
Retrieves an enumeration of the ids of the attributes in the attribute set. |
int |
hashCode()
Calculates the hash code of this BasicAttributes. |
boolean |
isCaseIgnored()
Determines whether the attribute set ignores the case of attribute identifiers when retrieving or adding attributes. |
Attribute |
put(Attribute attr)
Adds a new attribute to the attribute set. |
Attribute |
put(String attrID,
Object val)
Adds a new attribute to the attribute set. |
Attribute |
remove(String attrID)
Removes the attribute with the attribute id 'attrID' from the attribute set. |
int |
size()
Retrieves the number of attributes in the attribute set. |
String |
toString()
Generates the string representation of this attribute set. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BasicAttributes()
public BasicAttributes(boolean ignoreCase)
ignoreCase is true, the character case of attribute
identifiers is ignored; otherwise the case is significant.
ignoreCase - true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected.public BasicAttributes(String attrID, Object val)
attrID - non-null The id of the attribute to add.val - The value of the attribute to add. If null, a null
value is added to the attribute.public BasicAttributes(String attrID, Object val, boolean ignoreCase)
ignoreCase is true, the character case of attribute
identifiers is ignored; otherwise the case is significant.
attrID - non-null The id of the attribute to add.
If this attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.val - The value of the attribute to add. If null, a null
value is added to the attribute.ignoreCase - true means this attribute set will ignore
the case of its attribute identifiers
when retrieving or adding attributes;
false means case is respected.| Method Detail |
|---|
public Object clone()
Objectwill be true, and that the expression:
x.clone() != x
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().getClass() == x.getClass()
will be true, this is not an absolute requirement.
x.clone().equals(x)
By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().
By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.
The method clone for class Object performs a specific cloning operation. First, if the class of this object does not implement the interface Cloneable, then a CloneNotSupportedException is thrown. Note that all arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.
The class Object does not itself implement the interface Cloneable, so calling the clone method on an object whose class is Object will result in throwing an exception at run time.
clone in interface Attributesclone in class ObjectCloneablepublic boolean isCaseIgnored()
Attributes
isCaseIgnored in interface Attributespublic int size()
Attributes
size in interface Attributespublic Attribute get(String attrID)
Attributes
get in interface AttributesattrID - The non-null id of the attribute to retrieve.
If this attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.
Attributes.put(java.lang.String, java.lang.Object),
Attributes.remove(java.lang.String)public NamingEnumeration<Attribute> getAll()
Attributes
getAll in interface Attributespublic NamingEnumeration<String> getIDs()
Attributes
getIDs in interface Attributespublic Attribute put(String attrID, Object val)
Attributes
put in interface AttributesattrID - non-null The id of the attribute to add.
If the attribute set ignores the character
case of its attribute ids, the case of attrID
is ignored.val - The possibly null value of the attribute to add.
If null, the attribute does not have any values.
Attributes.remove(java.lang.String)public Attribute put(Attribute attr)
Attributes
put in interface Attributesattr - The non-null attribute to add.
If the attribute set ignores the character
case of its attribute ids, the case of
attr's identifier is ignored.
Attributes.remove(java.lang.String)public Attribute remove(String attrID)
Attributes
remove in interface AttributesattrID - The non-null id of the attribute to remove.
If the attribute set ignores the character
case of its attribute ids, the case of
attrID is ignored.
public String toString()
public boolean equals(Object obj)
obj - the possibly null object to compare against.
hashCode()public int hashCode()
The hash code is computed by adding the hash code of the attributes of this object. If this BasicAttributes ignores case of its attribute IDs, one is added to the hash code. If a subclass overrides hashCode(), it should override equals() as well so that two Attributes instances that are equal have the same hash code.
equals(java.lang.Object)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.
7 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)