Class KeySet<E>

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 KeySet<E> extends KeyCollection<E> implements Set<E>
KeySet implements a set. The elements allowed in the set can be constraint (null/duplicate values).
See Also:
  • Constructor Details

    • KeySet

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

    • getBuilder

      protected KeySet.Builder<E> getBuilder()
      Overrides:
      getBuilder in class KeyCollection<E>
      Returns:
      builder to use in extending classes
    • copy

      public KeySet<E> 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 KeyCollection<E>
      Returns:
      a copy of this collection
    • crop

      public KeySet<E> 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 KeyCollection<E>
      Returns:
      an empty copy of this collection
    • getAll

      public KeySet<E> getAll(E elem)
      Description copied from class: KeyCollectionImpl
      Returns all equal elements.
      Overrides:
      getAll in class KeyCollection<E>
      Parameters:
      elem - element
      Returns:
      all equal elements (never null)
    • filter

      public KeySet<E> 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 KeyCollection<E>
      Parameters:
      filter - filter predicate
      Returns:
      created list