Java Doc for Attribute.java in  » Apache-Harmony-Java-SE » javax-package » javax » naming » directory » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » javax package » javax.naming.directory 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.naming.directory.Attribute

All known Subclasses:   javax.naming.directory.BasicAttribute,
Attribute
public interface Attribute extends Cloneable,Serializable(Code)
This interface defines the valid operations on a particular attribute of a directory entry.

An attribute can have zero or more values. The value may be null.

When there are multiple values for a particular attribute, the collection of values may be specifically ordered or unordered. This interface provides a method for determining whether the order is maintained.

If the values of an attribute are ordered, then duplicates are allowed. If the values are unordered then duplicates are not allowed.

If the values are unordered then the indexed operations work as if the values added previously to the attribute had been done using ordered semantics. For example, if the values "a", "b" and "c" were previously added to an unordered attribute using "add("a"); add("b"); add("c");", it is equivalent to adding the same objects to an ordered attribute using "add(0,"a"); add(1,"b"); add(2,"c");". In this case, if we do "remove(1)" on the unordered list, the value "b" is removed, changing the index of "c" to 1.

Multiple null values can be added to an attribute. It is not the same as having no values on an attribute. If a null value is added to an unordered attribute which already has a null value, the add method has no effect.

A directory may optionally provide information about the syntax of an attribute's value via a schema. The methods getAttributeDefinition and getAttributeSyntaxDefinition return the schema definitions if they exist.

Note that updates to the attribute via this interface do not affect the directory directly. The only mechanism for modifying the directory is through the DirContext .

Concrete implementations of this Attribute interface may be either static or dynamic, and this interface does not make any distinction between the two types. A static attribute implementation retrieves its value from the directory once and stores it locally, a dynamic attribute implementation will go back to the directory for each request.



Field Summary
final static  longserialVersionUID
    


Method Summary
 voidadd(int index, Object val)
     Adds a value at the specified index.
 booleanadd(Object val)
     Adds a value to this attribute.
 voidclear()
     Clears all values of this attribute.
 Objectclone()
     Returns a deep copy of the attribute containing all the same values.
 booleancontains(Object val)
     Indicates whether the specified value is one of the attribute's values.
 Objectget()
     Gets a value of this attribute.
 Objectget(int index)
     Returns the value at the specified index, even for unordered values.
 NamingEnumerationgetAll()
     Returns an enumeration of all the attribute's values.
 DirContextgetAttributeDefinition()
     Returns the attribute's schema definition.
 DirContextgetAttributeSyntaxDefinition()
     Returns the attribute's syntax definition.
 StringgetID()
     Returns the identity of this attribute.
 booleanisOrdered()
     Indicates whether the values of this attribute are ordered or not.
 Objectremove(int index)
     Removes the values at the specified index, even for unordered values.
 booleanremove(Object val)
     Removes a value that is equal to the given value.
 Objectset(int index, Object val)
     Replaces the value at the specified index with the given value.
 intsize()
     Gets the count of the values in this attribute.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)





Method Detail
add
void add(int index, Object val)(Code)
Adds a value at the specified index. The index is only meaningful if the values are ordered. If there are already values at this index and above, they are moved up one position.

It is permissible to use this method when the values are not ordered but in this case, if a value equals to val already exists then this method throws an IllegalStateException because duplicates are not allowed.

The permitted range for index is 0 <= index <= size(). The range allows the list to grow by one. If the index is outside this range this method throws an IndexOutOfBoundsException.


Parameters:
  index - the position index
Parameters:
  val - a new value to be added which may be null
throws:
  IllegalStateException - If the new value equals to an existing value in an unorderedAttribute.
throws:
  IndexOutOfBoundsException - If the index is invalid.



add
boolean add(Object val)(Code)
Adds a value to this attribute. For unordered attribute values this method adds the new value unless the value is already present. If the new value is already present in unordered attribute values, the method has no effect.

For ordered attribute values, the new value is added at the end of list of values.

This method returns true or false to indicate whether a value was added.


Parameters:
  val - a new value to be added which may be null true if a value was added, otherwise false



clear
void clear()(Code)
Clears all values of this attribute.



clone
Object clone()(Code)
Returns a deep copy of the attribute containing all the same values. The values are not cloned. a deep clone of this attribute



contains
boolean contains(Object val)(Code)
Indicates whether the specified value is one of the attribute's values.
Parameters:
  val - the value which may be null true if this attribute contains the value, otherwise false



get
Object get() throws NamingException(Code)
Gets a value of this attribute. For unordered values, returns any of the values. For ordered values, returns the first. null is a valid value.

If the attribute has no values this method throws NoSuchElementException.

a value of this attribute
throws:
  NamingException - If the attribute has no value.



get
Object get(int index) throws NamingException(Code)
Returns the value at the specified index, even for unordered values. This method throws IndexOutOfBoundsException if the index is outside the valid range 0 <= index < size().

If the attribute has no values this method throws NoSuchElementException.


Parameters:
  index - the position index the value at the specified index
throws:
  IndexOutOfBoundsException - If the index is invalid.
throws:
  NamingException - If the attribute has no value.



getAll
NamingEnumeration getAll() throws NamingException(Code)
Returns an enumeration of all the attribute's values. The enumeration is ordered if the values are.

The effect on the returned enumeration of adding or removing values of the attribute is not specified.

This method will throw any NamingException that occurs.

an enumeration of all values of the attribute
throws:
  NamingException - If any NamingException occurs.



getAttributeDefinition
DirContext getAttributeDefinition() throws NamingException(Code)
Returns the attribute's schema definition. If this operation is not supported, an OperationNotSupportedException is thrown. If the implementation supports schemas but no schema is set, it is valid to return null.

This method will throw any NamingException that occurs.

the schema definitions if they exist
throws:
  NamingException - If any NamingException occurs.



getAttributeSyntaxDefinition
DirContext getAttributeSyntaxDefinition() throws NamingException(Code)
Returns the attribute's syntax definition. If this operation is not supported, an OperationNotSupportedException is thrown. If the implementation supports syntax definitions but no syntax definition is set, it is valid to return null.

This method will throw any NamingException that occurs.

the syntax definitions if they exist
throws:
  NamingException - If any NamingException occurs.



getID
String getID()(Code)
Returns the identity of this attribute. This method is not expected to return null. the ID of this attribute



isOrdered
boolean isOrdered()(Code)
Indicates whether the values of this attribute are ordered or not. true if the values of this attribute are ordered, otherwise false



remove
Object remove(int index)(Code)
Removes the values at the specified index, even for unordered values. Values at higher indexes move one position lower.

If the index is outside the valid range 0 <= index < size() this method throws an IndexOutOfBoundsException.


Parameters:
  index - the position index the removed value
throws:
  IndexOutOfBoundsException - If the index is invalid.



remove
boolean remove(Object val)(Code)
Removes a value that is equal to the given value. There may be more than one match in ordered value, in which case the equal value with the lowest index is removed. After an ordered value is removed, values at higher indexes move one position lower.

Returns true if a value is removed. If there is no value equal to val this method simply returns false.


Parameters:
  val - the value to be removed true if the value is removed, otherwise false



set
Object set(int index, Object val)(Code)
Replaces the value at the specified index with the given value. The old value (which may be null) is returned.

If the values are unordered and the given value is already present this method throws an IllegalStateException.

The valid range for the index is 0 <= index < size(). This method throws an IndexOutOfBoundsException if the index is outside this range.


Parameters:
  index - the position index
Parameters:
  val - the new value the original value at the specified index
throws:
  IndexOutOfBoundsException - If the index is invalid.



size
int size()(Code)
Gets the count of the values in this attribute. the count of the values in this attribute



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.