Class UnmodifiableBoundedCollection<E>

    • Method Detail

      • unmodifiableBoundedCollection

        public static <E> BoundedCollection<E> unmodifiableBoundedCollection(BoundedCollection<? extends E> coll)
        Factory method to create an unmodifiable bounded collection.
        Type Parameters:
        E - the type of the elements in the collection
        Parameters:
        coll - the BoundedCollection to decorate, must not be null
        Returns:
        a new unmodifiable bounded collection
        Throws:
        NullPointerException - if coll is null
        Since:
        4.0
      • unmodifiableBoundedCollection

        public static <E> BoundedCollection<E> unmodifiableBoundedCollection(Collection<? extends E> coll)
        Factory method to create an unmodifiable bounded collection.

        This method is capable of drilling down through up to 1000 other decorators to find a suitable BoundedCollection.

        Type Parameters:
        E - the type of the elements in the collection
        Parameters:
        coll - the BoundedCollection to decorate, must not be null
        Returns:
        a new unmodifiable bounded collection
        Throws:
        NullPointerException - if coll is null
        IllegalArgumentException - if coll is not a BoundedCollection
        Since:
        4.0
      • add

        public boolean add(E object)
      • addAll

        public boolean addAll(Collection<? extends E> coll)
      • clear

        public void clear()
      • remove

        public boolean remove(Object object)
      • removeAll

        public boolean removeAll(Collection<?> coll)
      • retainAll

        public boolean retainAll(Collection<?> coll)
      • isFull

        public boolean isFull()
        Description copied from interface: BoundedCollection
        Returns true if this collection is full and no new elements can be added.
        Specified by:
        isFull in interface  BoundedCollection<E>
        Returns:
        true if the collection is full
      • maxSize

        public int maxSize()
        Description copied from interface: BoundedCollection
        Gets the maximum size of the collection (the bound).
        Specified by:
        maxSize in interface  BoundedCollection<E>
        Returns:
        the maximum number of elements the collection can hold