it.unimi.dsi.fastutil.objects
Class AbstractObjectCollection

java.lang.Object
  extended byit.unimi.dsi.fastutil.objects.AbstractObjectCollection
All Implemented Interfaces:
Collection, ObjectCollection
Direct Known Subclasses:
AbstractObjectList, AbstractObjectSet

public abstract class AbstractObjectCollection
extends Object
implements ObjectCollection

An abstract class providing basic methods for collections implementing a type-specific interface.

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


Method Summary
 boolean add(Object k)
           
 boolean addAll(Collection c)
          Adds all elements of the given collection to this collection.
 boolean containsAll(Collection c)
          Checks whether this collection contains all elements from the given collection.
 boolean isEmpty()
           
 Iterator iterator()
          Delegates to the corresponding type-specific method.
 boolean remove(Object k)
           
 boolean removeAll(Collection c)
          Remove from this collection all elements in the given collection.
 boolean retainAll(Collection c)
          Retains in this collection only elements from the given collection.
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectCollection
objectIterator
 
Methods inherited from interface java.util.Collection
clear, contains, equals, hashCode, size
 

Method Detail

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection

addAll

public boolean addAll(Collection c)
Adds all elements of the given collection to this collection.

Specified by:
addAll in interface Collection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

add

public boolean add(Object k)
Specified by:
add in interface Collection

remove

public boolean remove(Object k)
Specified by:
remove in interface Collection

iterator

public Iterator iterator()
Delegates to the corresponding type-specific method.

Specified by:
iterator in interface Collection

containsAll

public boolean containsAll(Collection c)
Checks whether this collection contains all elements from the given collection.

Specified by:
containsAll in interface Collection
Parameters:
c - a collection.
Returns:
true if this collection contains all elements of the argument.

retainAll

public boolean retainAll(Collection c)
Retains in this collection only elements from the given collection.

Specified by:
retainAll in interface Collection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

removeAll

public boolean removeAll(Collection c)
Remove from this collection all elements in the given collection. If the collection is an instance of this class, it uses faster iterators.

Specified by:
removeAll in interface Collection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection

toString

public String toString()