|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--netscape.ldap.LDAPAttributeSet
Represents a set of attributes (for example, the set of attributes in an entry).
LDAPAttribute
Constructor Summary | |
LDAPAttributeSet()
Constructs a new set of attributes. |
|
LDAPAttributeSet(LDAPAttribute[] attrs)
Constructs an attribute set. |
Method Summary | |
void |
add(LDAPAttribute attr)
Adds the specified attribute to this attribute set. |
java.lang.Object |
clone()
|
LDAPAttribute |
elementAt(int index)
Returns the attribute at the position specified by the index. |
LDAPAttribute |
getAttribute(java.lang.String attrName)
Returns a single attribute that exactly matches the specified attribute name. |
LDAPAttribute |
getAttribute(java.lang.String attrName,
java.lang.String lang)
Returns the subtype that matches the attribute name specified by attrName and the language specificaton identified
by lang . |
java.util.Enumeration |
getAttributes()
Returns an enumeration of the attributes in this attribute set. |
LDAPAttributeSet |
getSubset(java.lang.String subtype)
Creates a new attribute set containing only the attributes that have the specified subtypes. |
void |
remove(java.lang.String name)
Removes the specified attribute from the set. |
void |
removeElementAt(int index)
Removes the attribute at the position specified by the index. |
int |
size()
Returns the number of attributes in this set. |
java.lang.String |
toString()
Retrieves the string representation of all attributes in the attribute set. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public LDAPAttributeSet()
public LDAPAttributeSet(LDAPAttribute[] attrs)
attrs
- the list of attributesMethod Detail |
public java.lang.Object clone()
public java.util.Enumeration getAttributes()
public LDAPAttributeSet getSubset(java.lang.String subtype)
For example, suppose an attribute set contains the following attributes:
cn cn;lang-ja sn;phonetic;lang-ja sn;lang-usIf you call the
getSubset
method and pass
lang-ja
as the argument, the method returns
an attribute set containing the following attributes:
cn;lang-ja sn;phonetic;lang-ja
subtype
- semi-colon delimited list of subtypes
to find within attribute names.
For example:
"lang-ja" // Only Japanese language subtypes "binary" // Only binary subtypes "binary;lang-ja" // Only Japanese language subtypes which also are binary
LDAPAttribute
,
getAttribute(java.lang.String)
,
LDAPEntry.getAttributeSet()
public LDAPAttribute getAttribute(java.lang.String attrName)
attrName
- name of attribute to return
For example:
"cn" // Only a non-subtyped version of cn "cn;lang-ja" // Only a Japanese version of cn
LDAPAttribute
public LDAPAttribute getAttribute(java.lang.String attrName, java.lang.String lang)
attrName
and the language specificaton identified
by lang
.
If no attribute in the set has the specified name and subtype,
the method returns null
.
Attributes containing subtypes other than lang
(for example, cn;binary
) are returned only if
they contain the specified lang
subtype and if
the set contains no attribute having only the lang
subtype. (For example, getAttribute( "cn", "lang-ja" )
returns cn;lang-ja;phonetic
only if the
cn;lang-ja
attribute does not exist.)
If null is specified for the lang
argument,
calling this method is the same as calling the
getAttribute(attrName)
method.
For example, suppose an entry contains only the following attributes:
cn;lang-en
cn;lang-ja-JP-kanji
sn
Calling the following methods will return the following values:
getAttribute( "cn" )
returns null
.
getAttribute( "sn" )
returns the "sn
" attribute.
getAttribute( "cn", "lang-en-us" )
returns the "cn;lang-en
" attribute.
getAttribute( "cn", "lang-en" )
returns the "cn;lang-en
" attribute.
getAttribute( "cn", "lang-ja" )
returns null
.
getAttribute( "sn", "lang-en" )
returns the "sn
" attribute.
attrName
- name of attribute to find in the entrylang
- a language specificationLDAPAttribute
public LDAPAttribute elementAt(int index)
index
- index of the attribute to obtainpublic void removeElementAt(int index)
index
- index of the attribute to removepublic int size()
public void add(LDAPAttribute attr)
attr
- attribute to add to this setpublic void remove(java.lang.String name)
name
- name of the attribute to removepublic java.lang.String toString()
LDAPAttributeSet: LDAPAttribute {type='cn', values='Barbara Jensen,Babs Jensen'}LDAPAttribute {type='sn', values='Jensen'}LDAPAttribute {type=' givenname', values='Barbara'}LDAPAttribute {type='objectclass', values= 'top,person,organizationalPerson,inetOrgPerson'}LDAPAttribute {type='ou', values='Product Development,People'}
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |