@@ -25,10 +25,10 @@ public abstract class ArrayUtils {
25
25
* @param end the end index (exclusive), must be >= 0 and <= source.length and >= start
26
26
* @return a newly allocated array with the extracted elements and length (end - start)
27
27
*/
28
- public static Object [] extractRange (int [] source , int start , int end ) {
28
+ public static int [] extractRange (int [] source , int start , int end ) {
29
29
assert checkExtractRangeArgs (source , start , end );
30
30
int length = end - start ;
31
- Object [] result = new Object [length ];
31
+ int [] result = new int [length ];
32
32
System .arraycopy (source , start , result , 0 , length );
33
33
return result ;
34
34
}
@@ -49,10 +49,10 @@ private static boolean checkExtractRangeArgs(int[] source, int start, int end) {
49
49
* @param end the end index (exclusive), must be >= 0 and <= source.length and >= start
50
50
* @return a newly allocated array with the extracted elements and length (end - start)
51
51
*/
52
- public static Object [] extractRange (long [] source , int start , int end ) {
52
+ public static long [] extractRange (long [] source , int start , int end ) {
53
53
assert checkExtractRangeArgs (source , start , end );
54
54
int length = end - start ;
55
- Object [] result = new Object [length ];
55
+ long [] result = new long [length ];
56
56
System .arraycopy (source , start , result , 0 , length );
57
57
return result ;
58
58
}
@@ -73,10 +73,10 @@ private static boolean checkExtractRangeArgs(long[] source, int start, int end)
73
73
* @param end the end index (exclusive), must be >= 0 and <= source.length and >= start
74
74
* @return a newly allocated array with the extracted elements and length (end - start)
75
75
*/
76
- public static Object [] extractRange (double [] source , int start , int end ) {
76
+ public static double [] extractRange (double [] source , int start , int end ) {
77
77
assert checkExtractRangeArgs (source , start , end );
78
78
int length = end - start ;
79
- Object [] result = new Object [length ];
79
+ double [] result = new double [length ];
80
80
System .arraycopy (source , start , result , 0 , length );
81
81
return result ;
82
82
}
0 commit comments