Source Code Cross Referenced for RoleList.java in  » JMX » jfoxmx » javax » management » relation » 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 » JMX » jfoxmx » javax.management.relation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* JFox, the OpenSource J2EE Application Server
002:         *
003:         * Copyright (C) 2002 huihoo.org
004:         * Distributable under GNU LGPL license
005:         * See the GNU Lesser General Public License for more details.
006:         */
007:
008:        package javax.management.relation;
009:
010:        import java.util.ArrayList;
011:        import java.util.List;
012:
013:        /**
014:         * A RoleList represents a list of roles (Role objects). It is used as
015:         * parameter when creating a relation, and when trying to set several roles in
016:         * a relation (via 'setRoles()' method). It is returned as part of a
017:         * RoleResult, to provide roles successfully retrieved.
018:         *
019:         * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
020:         */
021:
022:        public class RoleList extends ArrayList {
023:
024:            public RoleList() {
025:                super ();
026:            }
027:
028:            /**
029:             * Constructs an empty RoleList with the initial capacity
030:             * specified.
031:             *
032:             * @param initialCapacity  initial capacity
033:             */
034:            public RoleList(int initialCapacity) {
035:                super (initialCapacity);
036:            }
037:
038:            /**
039:             * Constructs a RoleList containing the elements of the
040:             * ArrayList specified, in the order in which they are returned
041:             * by the ArrayList's iterator. The RoleList instance has
042:             * an initial capacity of 110% of the size of the ArrayList
043:             * specified.
044:             *
045:             * @param roleList  list of Role objects
046:             *
047:             * @exception IllegalArgumentException  if:
048:             * <P>- null parameter
049:             * <P>or
050:             * <P>- an element in the ArrayList is not a Role
051:             */
052:            public RoleList(List roleList) throws IllegalArgumentException {
053:
054:                if (roleList == null)
055:                    throw new IllegalArgumentException(
056:                            "Invalid parameter: roleList can not be null");
057:
058:                for (int i = 0; i < roleList.size(); i++) {
059:                    Object obj = roleList.get(i);
060:                    if (!(obj instanceof  Role)) {
061:                        throw new IllegalArgumentException(
062:                                "The element at index " + i + "is not a Role, "
063:                                        + obj.toString());
064:                    }
065:                }
066:                super .addAll(roleList);
067:            }
068:
069:            /**
070:             * Adds the Role specified as the last element of the list.
071:             *
072:             * @param theRole  the role to be added.
073:             *
074:             * @exception IllegalArgumentException  if the role is null.
075:             */
076:            public void add(Role theRole) throws IllegalArgumentException {
077:                if (theRole == null)
078:                    throw new IllegalArgumentException(
079:                            "Invalid parameter: theRole can not be null");
080:                super .add(theRole);
081:            }
082:
083:            /**
084:             * Inserts the role specified as an element at the position specified.
085:             * Elements with an index greater than or equal to the current position are
086:             * shifted up.
087:             *
088:             * @param theIndex  The position in the list where the new Role
089:             * object is to be inserted.
090:             * @param theRole  The Role object to be inserted.
091:             *
092:             * @exception IllegalArgumentException  if the role is null.
093:             * @exception IndexOutOfBoundsException  if accessing with an index
094:             * outside of the list.
095:             */
096:            public void add(int theIndex, Role theRole)
097:                    throws IllegalArgumentException, IndexOutOfBoundsException {
098:                if (theRole == null)
099:                    throw new IllegalArgumentException(
100:                            "Invalid parameter: theRole can not be null");
101:                super .add(theIndex, theRole);
102:            }
103:
104:            /**
105:             * Sets the element at the position specified to be the role
106:             * specified.
107:             * The previous element at that position is discarded.
108:             *
109:             * @param theIndex  The position specified.
110:             * @param theRole  The value to which the role element should be set.
111:             *
112:             * @exception IllegalArgumentException  if the role is null.
113:             * @exception IndexOutOfBoundsException  if accessing with an index
114:             * outside of the list.
115:             */
116:            public void set(int theIndex, Role theRole)
117:                    throws IllegalArgumentException, IndexOutOfBoundsException {
118:                if (theRole == null)
119:                    throw new IllegalArgumentException(
120:                            "Invalid parameter: theRole can not be null");
121:                super .set(theIndex, theRole);
122:            }
123:
124:            /**
125:             * Appends all the elements in the RoleList specified to the end
126:             * of the list, in the order in which they are returned by the Iterator of
127:             * the RoleList specified.
128:             *
129:             * @param _roleList  Elements to be inserted into the list (can be null)
130:             *
131:             * @exception IndexOutOfBoundsException  if accessing with an index
132:             * outside of the list.
133:             */
134:            public boolean addAll(RoleList _roleList)
135:                    throws IndexOutOfBoundsException {
136:                if (_roleList == null) {
137:                    return true;
138:                }
139:                return (super .addAll(_roleList));
140:            }
141:
142:            /**
143:             * Inserts all of the elements in the RoleList specified into this
144:             * list, starting at the specified position, in the order in which they are
145:             * returned by the Iterator of the RoleList specified.
146:             *
147:             * @param theIndex  Position at which to insert the first element from the
148:             * RoleList specified.
149:             * @param _roleList  Elements to be inserted into the list.
150:             *
151:             * @exception IllegalArgumentException  if the role is null.
152:             * @exception IndexOutOfBoundsException  if accessing with an index
153:             * outside of the list.
154:             */
155:            public boolean addAll(int theIndex, RoleList _roleList)
156:                    throws IllegalArgumentException, IndexOutOfBoundsException {
157:                if (_roleList == null)
158:                    throw new IllegalArgumentException(
159:                            "Invalid parameter: roleList can not be null");
160:                return (super .addAll(theIndex, _roleList));
161:            }
162:
163:            /**
164:             * Cloning
165:             * <P>Returns a new RoleList, but no copy of the included elements.
166:             */
167:            public Object clone() {
168:                ArrayList array = (ArrayList) (super .clone());
169:                return new RoleList(array);
170:            }
171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.