Package nom.tam.util.array
Class MultiArrayCopier<Source,Destination>
java.lang.Object
nom.tam.util.array.MultiArrayCopier<Source,Destination>
- Type Parameters:
Source
- The generic type of array from which we want to copy elementsDestination
- The generic type of array to which we want to copy elements.
Make deep copies of multi-dimensional arrays.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <Source,
Destination>
voidcopyInto
(Source fromArray, Destination toArray) Copies the contents of one array into another.
-
Method Details
-
copyInto
public static <Source,Destination> void copyInto(Source fromArray, Destination toArray) Copies the contents of one array into another. The two arrays should match in shape and size, but may be of different types. Casting will be used to convert between types if necessary (e.g.double[][]
toint[][]
). .- Type Parameters:
Source
- The generic type of array from which we want to copy elementsDestination
- The generic type of array to which we want to copy elements.- Parameters:
fromArray
- the source array, whose data is to be copiedtoArray
- the destination array, into which data is copied
-