Class ImmutableCollection.ArrayBasedBuilder<E>

    • Field Detail

      • contents

        java.lang.Object[] contents
      • size

        int size
    • Constructor Detail

      • ArrayBasedBuilder

        ArrayBasedBuilder​(int initialCapacity)
    • Method Detail

      • ensureCapacity

        private void ensureCapacity​(int minCapacity)
        Expand the absolute capacity of the builder so it can accept at least the specified number of elements without being resized.
      • addAll

        public ImmutableCollection.Builder<E> addAll​(java.lang.Iterable<? extends E> elements)
        Description copied from class: ImmutableCollection.Builder
        Adds each element of elements to the ImmutableCollection being built.

        Note that each builder class overrides this method in order to covariantly return its own type.

        Overrides:
        addAll in class ImmutableCollection.Builder<E>
        Parameters:
        elements - the elements to add
        Returns:
        this Builder instance