Class OptimizedForSingleValueSet<T>

    • Field Detail

      • holderArray

        private boolean holderArray
      • holder

        @CheckForNull
        private java.lang.Object holder
    • Constructor Detail

      • OptimizedForSingleValueSet

        public OptimizedForSingleValueSet()
    • Method Detail

      • add

        public boolean add​(T object)
        Add object to set
        Parameters:
        object - object
        Returns:
        true if object was added to a set
      • remove

        public boolean remove​(T object)
        Remove object from set
        Parameters:
        object - object
        Returns:
        true if object was removed from the set
      • isEmpty

        public boolean isEmpty()
        Returns:
        true if set is empty
      • toArray

        public T[] toArray()
        Returns:
        values as array (not a copy array!)
      • addSingle

        private boolean addSingle​(T object)
      • addToArray

        private boolean addToArray​(T object)
      • newArray

        protected abstract T[] newArray​(int length)
      • removeSingle

        private boolean removeSingle​(T object)
      • removeFromArray

        private boolean removeFromArray​(T object)
      • holderToArray

        @Nonnull
        private T[] holderToArray()