it.unimi.dsi.fastutil.objects
Class AbstractReferenceCollection

java.lang.Object
  extended byit.unimi.dsi.fastutil.objects.AbstractReferenceCollection
All Implemented Interfaces:
Collection, ReferenceCollection
Direct Known Subclasses:
AbstractReferenceList, AbstractReferenceSet

public abstract class AbstractReferenceCollection
extends Object
implements ReferenceCollection

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.
 void clear()
           
 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 rem(Object k)
           
 boolean remove(Object ok)
           
 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.ReferenceCollection
objectIterator
 
Methods inherited from interface java.util.Collection
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

rem

public boolean rem(Object k)

remove

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

clear

public void clear()
Specified by:
clear 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()