Source Code Cross Referenced for Arrays.java in  » Web-Framework » anvil » anvil » util » 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 » Web Framework » anvil » anvil.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: Arrays.java,v 1.2 2002/09/16 08:05:07 jkl Exp $
003:         *
004:         * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
005:         *
006:         * Use is subject to license terms, as defined in
007:         * Anvil Sofware License, Version 1.1. See LICENSE 
008:         * file, or http://njet.org/license-1.1.txt
009:         */
010:        package anvil.util;
011:
012:        public class Arrays {
013:
014:            public static final boolean[] extend(boolean[] array) {
015:                int length = array.length;
016:                boolean[] newarray = new boolean[length + 1];
017:                System.arraycopy(array, 0, newarray, 0, length);
018:                return newarray;
019:            }
020:
021:            public static final char[] extend(char[] array) {
022:                int length = array.length;
023:                char[] newarray = new char[length + 1];
024:                System.arraycopy(array, 0, newarray, 0, length);
025:                return newarray;
026:            }
027:
028:            public static final short[] extend(short[] array) {
029:                int length = array.length;
030:                short[] newarray = new short[length + 1];
031:                System.arraycopy(array, 0, newarray, 0, length);
032:                return newarray;
033:            }
034:
035:            public static final int[] extend(int[] array) {
036:                int length = array.length;
037:                int[] newarray = new int[length + 1];
038:                System.arraycopy(array, 0, newarray, 0, length);
039:                return newarray;
040:            }
041:
042:            public static final long[] extend(long[] array) {
043:                int length = array.length;
044:                long[] newarray = new long[length + 1];
045:                System.arraycopy(array, 0, newarray, 0, length);
046:                return newarray;
047:            }
048:
049:            public static final float[] extend(float[] array) {
050:                int length = array.length;
051:                float[] newarray = new float[length + 1];
052:                System.arraycopy(array, 0, newarray, 0, length);
053:                return newarray;
054:            }
055:
056:            public static final double[] extend(double[] array) {
057:                int length = array.length;
058:                double[] newarray = new double[length + 1];
059:                System.arraycopy(array, 0, newarray, 0, length);
060:                return newarray;
061:            }
062:
063:            public static final String[] extend(String[] array) {
064:                int length = array.length;
065:                String[] newarray = new String[length + 1];
066:                System.arraycopy(array, 0, newarray, 0, length);
067:                return newarray;
068:            }
069:
070:            public static final Object[] extend(Object[] array) {
071:                int length = array.length;
072:                Object[] newarray = new Object[length + 1];
073:                System.arraycopy(array, 0, newarray, 0, length);
074:                return newarray;
075:            }
076:
077:            public static final Object[] extend(Object[] array, Class ofType) {
078:                int length = array.length;
079:                Object[] newarray = (Object[]) java.lang.reflect.Array
080:                        .newInstance(ofType, length);
081:                System.arraycopy(array, 0, newarray, 0, length);
082:                return newarray;
083:            }
084:
085:            public static final boolean[] extend(boolean[] array, int newlength) {
086:                boolean[] newarray = new boolean[newlength];
087:                System.arraycopy(array, 0, newarray, 0, array.length);
088:                return newarray;
089:            }
090:
091:            public static final char[] extend(char[] array, int newlength) {
092:                char[] newarray = new char[newlength];
093:                System.arraycopy(array, 0, newarray, 0, array.length);
094:                return newarray;
095:            }
096:
097:            public static final short[] extend(short[] array, int newlength) {
098:                short[] newarray = new short[newlength];
099:                System.arraycopy(array, 0, newarray, 0, array.length);
100:                return newarray;
101:            }
102:
103:            public static final int[] extend(int[] array, int newlength) {
104:                int[] newarray = new int[newlength];
105:                System.arraycopy(array, 0, newarray, 0, array.length);
106:                return newarray;
107:            }
108:
109:            public static final long[] extend(long[] array, int newlength) {
110:                long[] newarray = new long[newlength];
111:                System.arraycopy(array, 0, newarray, 0, array.length);
112:                return newarray;
113:            }
114:
115:            public static final float[] extend(float[] array, int newlength) {
116:                float[] newarray = new float[newlength];
117:                System.arraycopy(array, 0, newarray, 0, array.length);
118:                return newarray;
119:            }
120:
121:            public static final double[] extend(double[] array, int newlength) {
122:                double[] newarray = new double[newlength];
123:                System.arraycopy(array, 0, newarray, 0, array.length);
124:                return newarray;
125:            }
126:
127:            public static final String[] extend(String[] array, int newlength) {
128:                String[] newarray = new String[newlength];
129:                System.arraycopy(array, 0, newarray, 0, array.length);
130:                return newarray;
131:            }
132:
133:            public static final Object[] extend(Object[] array, int newlength) {
134:                Object[] newarray = new Object[newlength];
135:                System.arraycopy(array, 0, newarray, 0, array.length);
136:                return newarray;
137:            }
138:
139:            public static final Object[] extend(Object[] array, int newlength,
140:                    Class ofType) {
141:                Object[] newarray = (Object[]) java.lang.reflect.Array
142:                        .newInstance(ofType, newlength);
143:                System.arraycopy(array, 0, newarray, 0, array.length);
144:                return newarray;
145:            }
146:
147:            public static final boolean[] append(boolean[] array, boolean item) {
148:                int length = array.length;
149:                boolean[] newarray = new boolean[length + 1];
150:                System.arraycopy(array, 0, newarray, 0, length);
151:                newarray[length] = item;
152:                return newarray;
153:            }
154:
155:            public static final char[] append(char[] array, char item) {
156:                int length = array.length;
157:                char[] newarray = new char[length + 1];
158:                System.arraycopy(array, 0, newarray, 0, length);
159:                newarray[length] = item;
160:                return newarray;
161:            }
162:
163:            public static final short[] append(short[] array, short item) {
164:                int length = array.length;
165:                short[] newarray = new short[length + 1];
166:                System.arraycopy(array, 0, newarray, 0, length);
167:                newarray[length] = item;
168:                return newarray;
169:            }
170:
171:            public static final int[] append(int[] array, int item) {
172:                int length = array.length;
173:                int[] newarray = new int[length + 1];
174:                System.arraycopy(array, 0, newarray, 0, length);
175:                newarray[length] = item;
176:                return newarray;
177:            }
178:
179:            public static final long[] append(long[] array, long item) {
180:                int length = array.length;
181:                long[] newarray = new long[length + 1];
182:                System.arraycopy(array, 0, newarray, 0, length);
183:                newarray[length] = item;
184:                return newarray;
185:            }
186:
187:            public static final float[] append(float[] array, float item) {
188:                int length = array.length;
189:                float[] newarray = new float[length + 1];
190:                System.arraycopy(array, 0, newarray, 0, length);
191:                newarray[length] = item;
192:                return newarray;
193:            }
194:
195:            public static final double[] append(double[] array, double item) {
196:                int length = array.length;
197:                double[] newarray = new double[length + 1];
198:                System.arraycopy(array, 0, newarray, 0, length);
199:                newarray[length] = item;
200:                return newarray;
201:            }
202:
203:            public static final String[] append(String[] array, String item) {
204:                int length = array.length;
205:                String[] newarray = new String[length + 1];
206:                System.arraycopy(array, 0, newarray, 0, length);
207:                newarray[length] = item;
208:                return newarray;
209:            }
210:
211:            public static final Object[] append(Object[] array, Object item) {
212:                int length = array.length;
213:                Object[] newarray = new Object[length + 1];
214:                System.arraycopy(array, 0, newarray, 0, length);
215:                newarray[length] = item;
216:                return newarray;
217:            }
218:
219:            public static final Object[] append(Object[] array, Class ofType,
220:                    Object item) {
221:                int length = array.length;
222:                Object[] newarray = (Object[]) java.lang.reflect.Array
223:                        .newInstance(ofType, length);
224:                System.arraycopy(array, 0, newarray, 0, length);
225:                newarray[length] = item;
226:                return newarray;
227:            }
228:
229:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.