Class NullSkippingLinkedHashSet<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
java.util.LinkedHashSet<E>
io.github.connellite.collections.NullSkippingLinkedHashSet<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>

public class NullSkippingLinkedHashSet<E> extends LinkedHashSet<E>
LinkedHashSet that ignores null on add / addAll.
See Also:
  • Constructor Details

    • NullSkippingLinkedHashSet

      public NullSkippingLinkedHashSet()
    • NullSkippingLinkedHashSet

      public NullSkippingLinkedHashSet(int initialCapacity)
    • NullSkippingLinkedHashSet

      public NullSkippingLinkedHashSet(int initialCapacity, float loadFactor)
    • NullSkippingLinkedHashSet

      public NullSkippingLinkedHashSet(Collection<? extends E> c)
  • Method Details

    • add

      public boolean add(E e)
      Adds a non-null element to the set.
      Specified by:
      add in interface Collection<E>
      Specified by:
      add in interface Set<E>
      Overrides:
      add in class HashSet<E>
      Parameters:
      e - element to add
      Returns:
      true if element was added; false for null
    • addAll

      public boolean addAll(Collection<? extends E> c)
      Adds all non-null elements from the source collection.
      Specified by:
      addAll in interface Collection<E>
      Specified by:
      addAll in interface Set<E>
      Overrides:
      addAll in class AbstractCollection<E>
      Parameters:
      c - source collection
      Returns:
      true if at least one element was added