Class ValueArrays
java.lang.Object
com.quantfinlib.internal.ValueArrays
Defensive-copy helpers for immutable result types.
Result and report classes copy their array and collection arguments once
on construction and never hand out the internal copy. Callers read single
elements through indexed accessors (no allocation) and ask for a copy only
when they need the whole array. Collections are copied with
List.copyOf or an unmodifiable ordered copy at the call site.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[][]copy(double[][] a) Deep copy of a two-dimensional array.
-
Method Details
-
copy
public static double[][] copy(double[][] a) Deep copy of a two-dimensional array.- Parameters:
a- the array to copy, may be null; rows may be null- Returns:
- a new array with copied rows, or null when
ais null
-