Class _intList

    • Constructor Detail

      • _intList

        public _intList()
        Default constructor instantiating an empty instance with default (minimum) capacity.
      • _intList

        public _intList​(int initialCapacity)
        Initial capacity constructor instantiating an empty instance with a given initial capacity.

        The actual initial capacity is the highest of the following three values:

        • Integer MAX_VALUE, if the given initial capacity is greater than 2^30.
        • The lowest power of two value that is equal to or greater than the given initial capacity.
        • The default (minimum) capacity.
        Parameters:
        initialCapacity - the desired custom initial capacity.
      • _intList

        public _intList​(_intList original)
                 throws NullPointerException
        Copy constructor that instantiates a new instance with a copy of the passed original instance's data and same size.
        Parameters:
        original - the instance to be copied.
        Throws:
        NullPointerException - if null was passed.
        See Also:
        copy()
      • _intList

        public _intList​(int... elements)
                 throws NullPointerException
        Convenience initial data constructor, instantiating a new instance containing all elements of the passed array. The element size of the new instance will be equal to the passed array's length.

        Note that providing no element at all in the VarArgs parameter will automatically cause the default constructor _intList() to be used instead. Explicitely providing an null array reference will cause a NullPointerException.

        Parameters:
        elements - the initial elements for the new instance.
        Throws:
        NullPointerException - if an explicit null array reference was passed.
        See Also:
        _intList()
      • _intList

        public _intList​(int initialCapacity,
                        int[] src,
                        int srcStart,
                        int srcLength)
        Detailed initializing constructor allowing to specify initial capacity and a custom array range of initial data.

        The actual initial capacity will be calculated based on the higher of the two values initialCapacityand srcLength as described in _intList(int).

        The specified initial elements array range is copied via System.arraycopy(java.lang.Object, int, java.lang.Object, int, int).

        Parameters:
        initialCapacity - the desired initial capacity for the new instance.
        src - the source array containg the desired range of initial elements.
        srcStart - the start index of the desired range of initial elements in the source array.
        srcLength - the length of the desired range of initial elements in the source array.