Class Key1Set<E,​K>

  • Type Parameters:
    E - type of elements stored in the set
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>, ICollection<E>

    public class Key1Set<E,​K>
    extends Key1Collection<E,​K>
    implements java.util.Set<E>
    Key1Set implements a set. The elements allowed in the set can be constraint (null/duplicate values).
    See Also:
    Key1Collection, Serialized Form
    • Constructor Detail

      • Key1Set

        protected Key1Set()
        Protected constructor used by builder or derived collections.
    • Method Detail

      • copy

        public Key1Set<E,​K> copy()
        Description copied from class: KeyCollectionImpl
        Returns a copy of this collection with all its elements. The new collection will use the same comparator, ordering, etc.
        Specified by:
        copy in interface ICollection<E>
        Overrides:
        copy in class Key1Collection<E,​K>
        Returns:
        a copy of this collection
      • crop

        public Key1Set<E,​K> crop()
        Description copied from class: KeyCollectionImpl
        Returns a copy of this collection but without elements. The new collection will use the same comparator, ordering, etc.
        Specified by:
        crop in interface ICollection<E>
        Overrides:
        crop in class Key1Collection<E,​K>
        Returns:
        an empty copy of this collection
      • getAll

        public Key1Set<E,​K> getAll​(E elem)
        Description copied from class: KeyCollectionImpl
        Returns all equal elements.
        Overrides:
        getAll in class Key1Collection<E,​K>
        Parameters:
        elem - element
        Returns:
        all equal elements (never null)
      • getAllByKey1

        public Key1Set<E,​K> getAllByKey1​(K key)
        Description copied from class: Key1Collection
        Returns all elements with specified key.
        Overrides:
        getAllByKey1 in class Key1Collection<E,​K>
        Parameters:
        key - key
        Returns:
        all elements with specified key (never null)
      • filter

        public Key1Set<E,​K> filter​(java.util.function.Predicate<? super E> filter)
        Description copied from interface: ICollection
        Create a new collection by applying the specified filter to all elements. The returned collection has the same type as the original one.
        Specified by:
        filter in interface ICollection<E>
        Overrides:
        filter in class Key1Collection<E,​K>
        Parameters:
        filter - filter predicate
        Returns:
        created list