Class CList<E>

    • Constructor Detail

      • CList

        public CList()
      • CList

        public CList​(E... c)
      • CList

        public CList​(java.util.stream.Stream<E> stream)
      • CList

        public CList​(java.lang.Iterable<E> iterable)
    • Method Detail

      • join

        public java.lang.String join​(int fromIndex,
                                     int toIndex)

        Joins the elements of CList into a single String containing the provided elements.

        No delimiter is added before or after the list.

        See the examples here: CCollection.join(String).

        Parameters:
        fromIndex - low endpoint (inclusive) of the subList
        toIndex - high endpoint (exclusive) of the subList
        Returns:
        the joined String with no separator
      • join

        public java.lang.String join​(int fromIndex,
                                     int toIndex,
                                     java.lang.String separator)

        Joins the elements of CList into a single String containing the provided elements.

        No delimiter is added before or after the list. A null separator is the same as an empty String (CStringUtil.EMPTY).

        See the examples here: CCollection.join(String).

        Parameters:
        fromIndex - low endpoint (inclusive) of the subList
        toIndex - high endpoint (exclusive) of the subList
        separator - the separator character to use, null treated as CStringUtil.EMPTY
        Returns:
        the joined String separated by separator
      • set

        public CList<E> set​(java.util.Collection<? extends E> items)
        Clear list and appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.
        Parameters:
        items - collection containing elements to be added to this list
        Returns:
        current instance of CList
        Throws:
        java.lang.UnsupportedOperationException - if the addAll operation is not supported by this list
        java.lang.ClassCastException - if the class of an element of the specified collection prevents it from being added to this list
        java.lang.NullPointerException - if the specified collection contains one or more null elements and this list does not permit null elements, or if the specified collection is null
        java.lang.IllegalArgumentException - if some property of an element of the specified collection prevents it from being added to this list
        See Also:
        ArrayList.add(Object)
      • stream

        public java.util.stream.Stream<E> stream()
        Description copied from interface: CCollection
        Returns CCliItemCollection sequential Stream with this collection as its source.

        This method should be overridden when the CCollection.spliterator() method cannot return CCliItemCollection spliterator that is IMMUTABLE, CONCURRENT, or late-binding. (See CCollection.spliterator() for details.)

        Specified by:
        stream in interface CCollection<E>
        Specified by:
        stream in interface CIterable<E>
        Specified by:
        stream in interface java.util.Collection<E>
        Returns:
        CCliItemCollection sequential Stream over the elements in this collection
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.AbstractCollection<E>