Top Description Constructors Methods
org.jdom2.internal

public final Class ArrayCopy

extends Object
Class Inheritance
Imports
java.lang.reflect.Array

The copyOf methods on java.util.Arrays are introduced in Java6. Need an alternative to support Java5.
Author
Rolf Lear

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static final <
The generic type of the array we are copying.
E
>
E[]

Returns:

a new array that has the same elements as the source.
copyOf
(final E[]
the source array.
source
,
final int
the length of the new array copy.
len
)

Arrays.copyOf(...) is a Java6 thing.

public static final char[]

Returns:

a new array that has the same elements as the source.
copyOf
(final char[]
the source array.
source
,
final int
the length of the new array copy.
len
)

Arrays.copyOf(...) is a Java6 thing.

public static final int[]

Returns:

a new array that has the same elements as the source.
copyOf
(final int[]
the source array.
source
,
final int
the length of the new array copy.
len
)

Arrays.copyOf(...) is a Java6 thing.

public static final boolean[]

Returns:

a new array that has the same elements as the source.
copyOf
(final boolean[]
the source array.
source
,
final int
the length of the new array copy.
len
)

Arrays.copyOf(...) is a Java6 thing.

public static final <
The generic type of the array we are copying.
E
>
E[]

Returns:

a new array that has the same elements as the source.
copyOfRange
(final E[]
the source array.
source
,
final int
the start point of the copy (inclusive).
from
,
int
the end point of the copy (exclusive).
to
)

Arrays.copyOf(...) is a Java6 thing.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ArrayCopyback to summary
private ArrayCopy()

Method Detail

copyOfback to summary
public static final <E> E[] copyOf(final E[] source, final int len)

Arrays.copyOf(...) is a Java6 thing. This is a replacement.

Parameters
<E>
The generic type of the array we are copying.
source:E[]

the source array.

len:int

the length of the new array copy.

Returns:E[]

a new array that has the same elements as the source.

copyOfback to summary
public static final char[] copyOf(final char[] source, final int len)

Arrays.copyOf(...) is a Java6 thing. This is a replacement.

Parameters
source:char[]

the source array.

len:int

the length of the new array copy.

Returns:char[]

a new array that has the same elements as the source.

copyOfback to summary
public static final int[] copyOf(final int[] source, final int len)

Arrays.copyOf(...) is a Java6 thing. This is a replacement.

Parameters
source:int[]

the source array.

len:int

the length of the new array copy.

Returns:int[]

a new array that has the same elements as the source.

copyOfback to summary
public static final boolean[] copyOf(final boolean[] source, final int len)

Arrays.copyOf(...) is a Java6 thing. This is a replacement.

Parameters
source:boolean[]

the source array.

len:int

the length of the new array copy.

Returns:boolean[]

a new array that has the same elements as the source.

copyOfRangeback to summary
public static final <E> E[] copyOfRange(final E[] source, final int from, int to)

Arrays.copyOf(...) is a Java6 thing. This is a replacement.

Parameters
<E>
The generic type of the array we are copying.
source:E[]

the source array.

from:int

the start point of the copy (inclusive).

to:int

the end point of the copy (exclusive).

Returns:E[]

a new array that has the same elements as the source.