Package org.jdom2.internal
Class ArrayCopy
- java.lang.Object
-
- org.jdom2.internal.ArrayCopy
-
public final class ArrayCopy extends java.lang.ObjectThe copyOf methods on java.util.Arrays are introduced in Java6. Need an alternative to support Java5.- Author:
- Rolf Lear
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean[]copyOf(boolean[] source, int len)Arrays.copyOf(...) is a Java6 thing.static char[]copyOf(char[] source, int len)Arrays.copyOf(...) is a Java6 thing.static int[]copyOf(int[] source, int len)Arrays.copyOf(...) is a Java6 thing.static <E> E[]copyOf(E[] source, int len)Arrays.copyOf(...) is a Java6 thing.static <E> E[]copyOfRange(E[] source, int from, int to)Arrays.copyOf(...) is a Java6 thing.
-
-
-
Method Detail
-
copyOf
public static final <E> E[] copyOf(E[] source, int len)Arrays.copyOf(...) is a Java6 thing. This is a replacement.- Type Parameters:
E- The generic type of the array we are copying.- Parameters:
source- the source array.len- the length of the new array copy.- Returns:
- a new array that has the same elements as the source.
-
copyOfRange
public static final <E> E[] copyOfRange(E[] source, int from, int to)Arrays.copyOf(...) is a Java6 thing. This is a replacement.- Type Parameters:
E- The generic type of the array we are copying.- Parameters:
source- the source array.from- the start point of the copy (inclusive).to- the end point of the copy (exclusive).- Returns:
- a new array that has the same elements as the source.
-
copyOf
public static final char[] copyOf(char[] source, int len)Arrays.copyOf(...) is a Java6 thing. This is a replacement.- Parameters:
source- the source array.len- the length of the new array copy.- Returns:
- a new array that has the same elements as the source.
-
copyOf
public static final int[] copyOf(int[] source, int len)Arrays.copyOf(...) is a Java6 thing. This is a replacement.- Parameters:
source- the source array.len- the length of the new array copy.- Returns:
- a new array that has the same elements as the source.
-
copyOf
public static final boolean[] copyOf(boolean[] source, int len)Arrays.copyOf(...) is a Java6 thing. This is a replacement.- Parameters:
source- the source array.len- the length of the new array copy.- Returns:
- a new array that has the same elements as the source.
-
-