Class ImmutableAbstractCollection<E>

    • Field Detail

      • copyOrWrap

        protected final Immutable copyOrWrap
        COPY stores a safe, internal copy of the collection; WRAP stores a pointer to the original collection.
    • Constructor Detail

      • ImmutableAbstractCollection

        public ImmutableAbstractCollection​(Immutable copyOrWrap)
        Construct an abstract immutable collection.
        Parameters:
        copyOrWrap - Immutable; indicates whether the immutable is a copy or a wrap
    • Method Detail

      • getUnderlyingCollection

        protected abstract Collection<E> getUnderlyingCollection()
        Returns the underlying collection of this immutable collection. In case of Immutable.WRAP, this will be the original collection. In case of IMMUTABLE.COPY, this will be the internally stored (mutable) copy of the collection.
        Returns:
        the underlying collection of this immutable collection.