Package it.unimi.dsi.fastutil.objects
Class AbstractObjectCollection<K>
- java.lang.Object
-
- java.util.AbstractCollection<K>
-
- it.unimi.dsi.fastutil.objects.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)
andAbstractCollection.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 thenremove()
. A subclass must thus overriderem()
, rather thanremove()
, to make all inherited methods work properly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods 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
-
-
-
-
Method Detail
-
iterator
public abstract ObjectIterator<K> iterator()
Description copied from interface:ObjectCollection
Returns a type-specific iterator on the elements of this collection.Note that this specification strengthens the one given in
Iterable.iterator()
, which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extendsCollection
.- Specified by:
iterator
in interfacejava.util.Collection<K>
- Specified by:
iterator
in interfacejava.lang.Iterable<K>
- Specified by:
iterator
in interfaceObjectCollection<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in classjava.util.AbstractCollection<K>
- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.AbstractCollection<K>
-
-