Class AbstractObjectCollection<K>

All Implemented Interfaces:
ObjectCollection<K>, ObjectIterable<K>, java.lang.Iterable<K>, java.util.Collection<K>
Direct Known Subclasses:
AbstractObjectBigList, AbstractObjectList, AbstractObjectSet, ObjectCollections.EmptyCollection, ObjectCollections.IterableCollection

public abstract class AbstractObjectCollection<K>
extends java.util.AbstractCollection<K>
implements ObjectCollection<K>
An abstract class providing basic methods for collections implementing a type-specific interface.

In particular, this class provide iterator(), add(), AbstractCollection.remove(Object) and AbstractCollection.contains(Object) methods that just call the type-specific counterpart.

Warning: Because of a name clash between the list and collection interfaces the type-specific deletion method of a type-specific abstract collection is rem(), rather then remove(). A subclass must thus override rem(), rather than remove(), to make all inherited methods work properly.

  • Method Summary

    Modifier and Type Method Description
    abstract ObjectIterator<K> iterator()
    Returns a type-specific iterator on the elements of this collection.
    java.lang.String toString()  

    Methods inherited from class java.util.AbstractCollection

    add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, stream, toArray, toArray, toArray

    Methods inherited from interface java.lang.Iterable


    Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectCollection

  • Method Details

    • iterator

      public abstract ObjectIterator<K> iterator()
      Description copied from interface: ObjectCollection
      Returns a type-specific iterator on the elements of this collection.
      Specified by:
      iterator in interface java.util.Collection<K>
      Specified by:
      iterator in interface java.lang.Iterable<K>
      Specified by:
      iterator in interface ObjectCollection<K>
      Specified by:
      iterator in interface ObjectIterable<K>
      Specified by:
      iterator in class java.util.AbstractCollection<K>
      a type-specific iterator on the elements of this collection.
      See Also:
    • toString

      public java.lang.String toString()
      toString in class java.util.AbstractCollection<K>