Class BlackholeMap.BHSet<E>

  • Type Parameters:
    E - type of the entries for the set
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>
    Enclosing class:
    BlackholeMap<K,​V>

    private static class BlackholeMap.BHSet<E>
    extends java.util.AbstractSet<E>
    Blackhole implementation of Set. Always ignores add.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Set INSTANCE  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BHSet()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(E e)  
      java.util.Iterator<E> iterator()  
      static <T> java.util.Set<T> of()  
      int size()  
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        addAll, clear, contains, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray
    • Field Detail

      • INSTANCE

        private static final java.util.Set INSTANCE
    • Constructor Detail

      • BHSet

        private BHSet()
    • Method Detail

      • add

        public boolean add​(E e)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.Set<E>
        Overrides:
        add in class java.util.AbstractCollection<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.Set<E>
        Specified by:
        iterator in class java.util.AbstractCollection<E>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.Set<E>
        Specified by:
        size in class java.util.AbstractCollection<E>
      • of

        public static <T> java.util.Set<T> of()