Class CSet<E>

    • Constructor Detail

      • CSet

        public CSet()
      • CSet

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

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

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

      • contains

        public boolean contains​(java.lang.Object o)
        Description copied from interface: CCollection
        Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that Objects.equals(o, e).
        Specified by:
        contains in interface CCollection<E>
        Specified by:
        contains in interface CIterableState<E>
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.Set<E>
        Overrides:
        contains in class java.util.HashSet<E>
        Parameters:
        o - element whose presence in this collection is to be tested
        Returns:
        true if this collection contains the specified element
      • equals

        public boolean equals​(java.lang.Object c)
        Description copied from interface: CCollection
        Returns true if this collection equals the specified collection.
        Specified by:
        equals in interface CCollection<E>
        Specified by:
        equals in interface CIterable<E>
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.Set<E>
        Overrides:
        equals in class java.util.AbstractSet<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:
        CCollection.contains(Object)
      • forEach

        public void forEach​(java.util.function.Consumer<? super E> action)
        Description copied from interface: CCollection
        Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

        The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified CCliItemCollection concurrent modification policy.

        Specified by:
        forEach in interface CCollection<E>
        Specified by:
        forEach in interface CIterable<E>
        Specified by:
        forEach in interface java.lang.Iterable<E>
        Parameters:
        action - The action to be performed for each element
      • removeIf

        public boolean removeIf​(java.util.function.Predicate<? super E> filter)
        Description copied from interface: CCollection
        Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.
        Specified by:
        removeIf in interface CCollection<E>
        Specified by:
        removeIf in interface java.util.Collection<E>
        Parameters:
        filter - CCliItemCollection predicate which returns true for elements to be removed
        Returns:
        true if any elements were removed
      • set

        public CSet<E> set​(java.util.Collection<? extends E> items)
      • 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>