Class ObjectSet<T>

  • All Implemented Interfaces:
    Cloneable, Iterable<T>

    public class ObjectSet<T>
    extends ObjectTable<T>
    Restriction:
    This class is not intended to be subclassed by clients.
    • Field Detail

      • EMPTY_SET

        public static final ObjectSet EMPTY_SET
        An empty immutable ObjectSet.
    • Constructor Detail

      • ObjectSet

        public ObjectSet​(int initialSize)
        Constructs an empty ObjectSet, allocating an initial storage for the specified number of elements
        Parameters:
        initialSize -
      • ObjectSet

        public ObjectSet​(T[] items)
        Constructs an ObjectSet populated with the specified items, or an empty ObjectSet if the parameter is null
        Parameters:
        items -
    • Method Detail

      • emptySet

        public static <T> ObjectSet<T> emptySet()
        Since:
        5.1
      • checkPut

        public void checkPut​(T key)
        Adds the specified item to the set, or no-ops if the key is null
        Parameters:
        key - the item to add (may be null)
      • put

        public void put​(T key)
        Adds the specified item to the set
        Parameters:
        key - the (non-null) object to store
      • addAll

        public void addAll​(List<T> list)
        Adds each item in the list to this ObjectSet, or no-ops if list is null
        Parameters:
        list - a list (may be null)
      • addAll

        public void addAll​(ObjectSet<? extends T> set)
        Adds each item in the specified ObjectSet, or no-ops if the set is null
        Parameters:
        set - a set (may be null)
      • addAll

        public void addAll​(T[] objs)
        Adds each of the items in the specified array, or no-ops if the array is null
        Parameters:
        objs - an array (may be null)
      • remove

        public boolean remove​(T key)
        Remove the specified object from this ObjectSet
        Parameters:
        key - the (non-null) object to remove
        Returns:
        whether an object was removed