Class Key1Set<E,K>

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

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

    • Key1Set

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

    • getBuilder

      protected Key1Set.Builder<E,K> getBuilder()
      Overrides:
      getBuilder in class Key1Collection<E,K>
      Returns:
      builder to use in extending classes
    • 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(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