Source Code Cross Referenced for BaseListFormComponentVector.java in  » J2EE » Sofia » com » salmonllc » forms » 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 » J2EE » Sofia » com.salmonllc.forms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //** Copyright Statement ***************************************************
002:        //The Salmon Open Framework for Internet Applications (SOFIA)
003:        // Copyright (C) 1999 - 2002, Salmon LLC
004:        //
005:        // This program is free software; you can redistribute it and/or
006:        // modify it under the terms of the GNU General Public License version 2
007:        // as published by the Free Software Foundation;
008:        // 
009:        // This program is distributed in the hope that it will be useful,
010:        // but WITHOUT ANY WARRANTY; without even the implied warranty of
011:        // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:        // GNU General Public License for more details.
013:        // 
014:        // You should have received a copy of the GNU General Public License
015:        // along with this program; if not, write to the Free Software
016:        // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:        // 
018:        // For more information please visit http://www.salmonllc.com
019:        //** End Copyright Statement ***************************************************
020:        package com.salmonllc.forms;
021:
022:        /////////////////////////
023:        //$Archive: /JADE/SourceCode/com/salmonllc/forms/BaseListFormComponentVector.java $
024:        //$Author: Dan $ 
025:        //$Revision: 5 $ 
026:        //$Modtime: 10/30/02 2:58p $ 
027:        /////////////////////////
028:        import java.util.Vector;
029:
030:        /**
031:         * A type safe Vector that returns BaseListFormComponents and only accepts BaseListFormComponents
032:         */
033:        public class BaseListFormComponentVector {
034:
035:            private Vector _elements;
036:
037:            /**
038:             * BaseListFormElementsVector constructor comment.
039:             */
040:            public BaseListFormComponentVector() {
041:                _elements = new Vector();
042:            }
043:
044:            /**
045:             * BaseListFormElementsVector constructor comment.
046:             * @param initialCapacity int
047:             */
048:            public BaseListFormComponentVector(int initialCapacity) {
049:                _elements = new Vector(initialCapacity);
050:            }
051:
052:            /**
053:             * BaseListFormElementsVector constructor comment.
054:             * @param initialCapacity int
055:             * @param capacityIncrement int
056:             */
057:            public BaseListFormComponentVector(int initialCapacity,
058:                    int capacityIncrement) {
059:                _elements = new Vector(initialCapacity, capacityIncrement);
060:            }
061:
062:            /**
063:             * Adds the specified BaseListFormComponent to the end of this vector, 
064:             * increasing its size by one. The capacity of this vector is 
065:             * increased if its size becomes greater than its capacity. 
066:             *
067:             * @param   comp   the BaseListFormComponent to be added.
068:             */
069:            public void addElement(BaseListFormComponent comp) {
070:                _elements.addElement(comp);
071:            }
072:
073:            /**
074:             * Tests if the specified BaseListFormComponent is a component in this vector.
075:             *
076:             * @param   elem   a BaseListFormComponent.
077:             * @return  <code>true</code> if the specified object is a BaseListFormComponent in
078:             *          this vector; <code>false</code> otherwise.
079:             */
080:            public final boolean contains(BaseListFormComponent elem) {
081:                return _elements.contains(elem);
082:            }
083:
084:            /**
085:             * Copies the BaseListFormComponent of this vector into the specified array. 
086:             * The array must be big enough to hold all the objects in this  vector.
087:             *
088:             * @param   anArray   the array into which the BaseListFormComponent get copied.
089:             */
090:            public void copyInto(BaseListFormComponent anArray[]) {
091:                _elements.copyInto(anArray);
092:            }
093:
094:            /**
095:             * Returns the BaseListFormComponent at the specified index.
096:             *
097:             * @param      index   an index into this vector.
098:             * @return     the BaseListFormComponent at the specified index.
099:             * @exception  ArrayIndexOutOfBoundsException  if an invalid index was
100:             *               given.
101:             */
102:            public BaseListFormComponent elementAt(int index) {
103:                return (BaseListFormComponent) _elements.elementAt(index);
104:            }
105:
106:            /**
107:             * Searches for the first occurence of the given argument, testing 
108:             * for equality using the <code>equals</code> method. 
109:             *
110:             * @param   elem   an BaseListFormComponent.
111:             * @return  the index of the first occurrence of the argument in this
112:             *          vector; returns <code>-1</code> if the BaseListFormComponent is not found.
113:             * @see     java.lang.Object#equals(java.lang.Object)
114:             */
115:            public final int indexOf(BaseListFormComponent elem) {
116:                return _elements.indexOf(elem);
117:            }
118:
119:            /**
120:             * Searches for the first occurence of the given argument, beginning 
121:             * the search at <code>index</code>, and testing for equality using 
122:             * the <code>equals</code> method. 
123:             *
124:             * @param   elem    an BaseListFormComponent.
125:             * @param   index   the index to start searching from.
126:             * @return  the index of the first occurrence of the BaseListFormComponent argument in
127:             *          this vector at position <code>index</code> or later in the
128:             *          vector; returns <code>-1</code> if the object is not found.
129:             * @see     java.lang.Object#equals(java.lang.Object)
130:             */
131:            public int indexOf(BaseListFormComponent elem, int index) {
132:                return _elements.indexOf(elem, index);
133:            }
134:
135:            /**
136:             * Inserts the specified BaseListFormComponent as a component in this vector at the 
137:             * specified <code>index</code>. Each component in this vector with 
138:             * an index greater or equal to the specified <code>index</code> is 
139:             * shifted upward to have an index one greater than the value it had 
140:             * previously. 
141:             * <p>
142:             * The index must be a value greater than or equal to <code>0</code> 
143:             * and less than or equal to the current size of the vector. 
144:             *
145:             * @param      comp     the BaseListFormComponent to insert.
146:             * @param      index   where to insert the new component.
147:             * @exception  ArrayIndexOutOfBoundsException  if the index was invalid.
148:             * @see        java.util.Vector#size()
149:             */
150:            public void insertElementAt(BaseListFormComponent comp, int index) {
151:                _elements.insertElementAt(comp, index);
152:            }
153:
154:            /**
155:             * Returns the index of the last occurrence of the specified BaseListFormComponent in
156:             * this vector.
157:             *
158:             * @param   elem   the desired BaseListFormComponent.
159:             * @return  the index of the last occurrence of the specified BaseListFormComponent in
160:             *          this vector; returns <code>-1</code> if the object is not found.
161:             */
162:            public final int lastIndexOf(BaseListFormComponent elem) {
163:                return _elements.lastIndexOf(elem);
164:            }
165:
166:            /**
167:             * Searches backwards for the specified BaseListFormComponent, starting from the 
168:             * specified index, and returns an index to it. 
169:             *
170:             * @param   elem    the desired BaseListFormComponent.
171:             * @param   index   the index to start searching from.
172:             * @return  the index of the last occurrence of the specified BaseListFormComponent in this
173:             *          vector at position less than <code>index</code> in the vector;
174:             *          <code>-1</code> if the object is not found.
175:             */
176:            public int lastIndexOf(BaseListFormComponent elem, int index) {
177:                return _elements.lastIndexOf(elem, index);
178:            }
179:
180:            /**
181:             * Removes the first occurrence of the argument from this vector. If 
182:             * the BaseListFormComponent is found in this vector, each component in the vector 
183:             * with an index greater or equal to the object's index is shifted 
184:             * downward to have an index one smaller than the value it had previously.
185:             *
186:             * @param   comp   the component to be removed.
187:             * @return  <code>true</code> if the argument was a component of this
188:             *          vector; <code>false</code> otherwise.
189:             * @since   JDK1.0
190:             */
191:            public boolean removeComp(BaseListFormComponent comp) {
192:                return _elements.removeElement(comp);
193:            }
194:
195:            /**
196:             * Sets the component at the specified <code>index</code> of this 
197:             * vector to be the specified BaseListFormComponent. The previous component at that 
198:             * position is discarded. 
199:             * <p>
200:             * The index must be a value greater than or equal to <code>0</code> 
201:             * and less than the current size of the vector. 
202:             *
203:             * @param      comp     what the component is to be set to.
204:             * @param      index   the specified index.
205:             * @exception  ArrayIndexOutOfBoundsException  if the index was invalid.
206:             * @see        java.util.Vector#size()
207:             */
208:            public void setElementAt(BaseListFormComponent comp, int index) {
209:                _elements.setElementAt(comp, index);
210:            }
211:
212:            /**
213:             * Returns the number of components in this vector.
214:             *
215:             * @return  the number of components in this vector.
216:             */
217:            public int size() {
218:                return _elements.size();
219:            }
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.