Class ImmutableDoubleArray.Builder

    • Field Detail

      • array

        private double[] array
      • count

        private int count
    • Constructor Detail

      • Builder

        Builder​(int initialCapacity)
    • Method Detail

      • ensureRoomFor

        private void ensureRoomFor​(int numberToAdd)
      • expandedCapacity

        private static int expandedCapacity​(int oldCapacity,
                                            int minCapacity)
      • build

        public ImmutableDoubleArray build()
        Returns a new immutable array. The builder can continue to be used after this call, to append more values and build again.

        Performance note: the returned array is backed by the same array as the builder, so no data is copied as part of this step, but this may occupy more memory than strictly necessary. To copy the data to a right-sized backing array, use .build().trimmed().