Class HashTreePSet


  • public final class HashTreePSet
    extends java.lang.Object
    A static convenience class for creating efficient persistent sets.

    This class simply creates MapPSets backed by HashTreePMaps.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static MapPSet<java.lang.Object> EMPTY  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private HashTreePSet()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> MapPSet<E> empty()  
      static <E> MapPSet<E> from​(java.util.Collection<? extends E> list)  
      static <E> MapPSet<E> singleton​(E e)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EMPTY

        private static final MapPSet<java.lang.Object> EMPTY
    • Constructor Detail

      • HashTreePSet

        private HashTreePSet()
    • Method Detail

      • empty

        public static <E> MapPSet<E> empty()
        Type Parameters:
        E -
        Returns:
        an empty set
      • singleton

        public static <E> MapPSet<E> singleton​(E e)
        Type Parameters:
        E -
        Parameters:
        e -
        Returns:
        empty().plus(e)
      • from

        public static <E> MapPSet<E> from​(java.util.Collection<? extends E> list)
        Type Parameters:
        E -
        Parameters:
        list -
        Returns:
        empty().plusAll(map)