1 package org.apache.commons.ognl;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 public final class ObjectArrayPool
30 {
31 public ObjectArrayPool()
32 {
33 super();
34 }
35
36 public Object[] create( int arraySize )
37 {
38 return new Object[arraySize];
39 }
40
41 public Object[] create( Object singleton )
42 {
43 Object[] result = create( 1 );
44
45 result[0] = singleton;
46 return result;
47 }
48
49 public Object[] create( Object object1, Object object2 )
50 {
51 Object[] result = create( 2 );
52
53 result[0] = object1;
54 result[1] = object2;
55 return result;
56 }
57
58 public Object[] create( Object object1, Object object2, Object object3 )
59 {
60 Object[] result = create( 3 );
61
62 result[0] = object1;
63 result[1] = object2;
64 result[2] = object3;
65 return result;
66 }
67
68 public Object[] create( Object object1, Object object2, Object object3, Object object4 )
69 {
70 Object[] result = create( 4 );
71
72 result[0] = object1;
73 result[1] = object2;
74 result[2] = object3;
75 result[3] = object4;
76 return result;
77 }
78
79 public Object[] create( Object object1, Object object2, Object object3, Object object4, Object object5 )
80 {
81 Object[] result = create( 5 );
82
83 result[0] = object1;
84 result[1] = object2;
85 result[2] = object3;
86 result[3] = object4;
87 result[4] = object5;
88 return result;
89 }
90
91
92
93
94 public void recycle( Object[] value )
95 {
96
97 }
98 }