Class ValueArrays

java.lang.Object
com.quantfinlib.internal.ValueArrays

public final class ValueArrays extends Object
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 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 a is null