Class AlwaysSet<E>

  • Type Parameters:
    E - The element type
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    public final class AlwaysSet<E>
    extends PseudoSet<E>
    A Set that always returns true for the contains method.
    Author:
    Matthew Wakeling
    • Method Detail

      • getInstance

        public static <T> AlwaysSet<T> getInstance()
        Returns a new AlwaysSet with the correct type parameters.
        Type Parameters:
        T - The type of the Set
        Returns:
        a Set that contains everything
      • contains

        public boolean contains​(java.lang.Object o)
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<E>
        Specified by:
        containsAll in interface java.util.Set<E>
        Overrides:
        containsAll in class PseudoSet<E>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object