Class HashTreePBag


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

    This class simply creates MapPBags backed by HashTreePMaps.

    • Field Summary

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

      Constructors 
      Modifier Constructor Description
      private HashTreePBag()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> MapPBag<E> empty()  
      static <E> MapPBag<E> from​(java.util.Collection<? extends E> list)  
      static <E> MapPBag<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 MapPBag<java.lang.Object> EMPTY
    • Constructor Detail

      • HashTreePBag

        private HashTreePBag()
    • Method Detail

      • empty

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

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

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