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

      • of

        public static <C> CList<C> of​(C... c)
      • of

        public static <C> CList<C> of​(java.util.stream.Stream<C> stream)
      • of

        public static <C> CList<C> of​(java.lang.Iterable<C> iterable)
      • 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: CIterable.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: CIterable.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
      • stream

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

        This method should be overridden when the CCollection.spliterator() method cannot return 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:
        sequential Stream over the elements in this collection
      • equals

        public boolean equals​(java.lang.Object c)
        Description copied from interface: CIterable
        Returns true if this collection equals the specified collection.
        Specified by:
        equals in interface CIterable<E>
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.List<E>
        Overrides:
        equals in class java.util.ArrayList<E>
        Parameters:
        c - collection to be checked for equality
        Returns:
        true if this collection contains none of the elements in the specified collection
        See Also:
        CIterableState.contains(Object)
      • toString

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