Class AbstractCollection

    • Constructor Detail

      • AbstractCollection

        protected AbstractCollection()
        Makes this class non instantiable, but still let's others inherit from it.
    • Method Detail

      • clear

        public abstract void clear()
        Removes all elements from the receiver. The receiver will be empty after this call returns.
      • isEmpty

        public boolean isEmpty()
        Tests if the receiver has no elements.
        Returns:
        true if the receiver has no elements; false otherwise.
      • size

        public abstract int size()
        Returns the number of elements contained in the receiver.
        Returns:
        the number of elements contained in the receiver.
      • toList

        public abstract ArrayList toList()
        Returns a java.util.ArrayList containing all the elements in the receiver.
      • toString

        public String toString()
        Returns a string representation of the receiver, containing the String representation of each element.
        Overrides:
        toString in class Object