Class AbstractReadOnlyCollection<E>

java.lang.Object
org.jhotdraw8.icollection.readonly.AbstractReadOnlyCollection<E>
Type Parameters:
E - the element type
All Implemented Interfaces:
Iterable<E>, ReadOnlyCollection<E>
Direct Known Subclasses:
AbstractReadOnlyList, AbstractReadOnlySet, ReadOnlyCollectionFacade

public abstract class AbstractReadOnlyCollection<E> extends Object implements ReadOnlyCollection<E>
Abstract base class for ReadOnlyCollections.
  • Constructor Details

    • AbstractReadOnlyCollection

      public AbstractReadOnlyCollection()
      Sole constructor. (For invocation by subclass constructors, typically implicit.).
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this collection. The string representation consists of a list of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings as by String.valueOf(Object).
      Overrides:
      toString in class Object
      Returns:
      a string representation of this collection
    • contains

      public boolean contains(Object o)
      Description copied from interface: ReadOnlyCollection
      Returns true if this collection contains the specified object.
      Specified by:
      contains in interface ReadOnlyCollection<E>
      Parameters:
      o - an object
      Returns:
      true if this collection contains the specified object