it.unimi.dsi.fastutil.longs
Class AbstractLongSet

java.lang.Object
  extended by java.util.AbstractCollection<Long>
      extended by it.unimi.dsi.fastutil.longs.AbstractLongCollection
          extended by it.unimi.dsi.fastutil.longs.AbstractLongSet
All Implemented Interfaces:
LongCollection, LongIterable, LongSet, Cloneable, Iterable<Long>, Collection<Long>, Set<Long>
Direct Known Subclasses:
AbstractLongSortedSet, LongArraySet, LongOpenCustomHashSet, LongOpenHashBigSet, LongOpenHashSet, LongSets.Singleton

public abstract class AbstractLongSet
extends AbstractLongCollection
implements Cloneable, LongSet

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


Constructor Summary
protected AbstractLongSet()
           
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
          Returns a hash code for this set.
abstract  LongIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 boolean rem(long k)
          Delegates to remove().
 boolean remove(long k)
          Removes an element from this set.
 boolean remove(Object o)
          Delegates to the corresponding type-specific method.
 
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection
add, add, addAll, addAll, contains, contains, containsAll, containsAll, isEmpty, longIterator, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toLongArray, toLongArray, toString
 
Methods inherited from class java.util.AbstractCollection
clear, size
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
add, addAll, contains, containsAll, longIterator, removeAll, retainAll, toArray, toArray, toLongArray, toLongArray
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractLongSet

protected AbstractLongSet()
Method Detail

iterator

public abstract LongIterator iterator()
Description copied from interface: LongCollection
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 extends Collection.

Specified by:
iterator in interface LongCollection
Specified by:
iterator in interface LongIterable
Specified by:
iterator in interface LongSet
Specified by:
iterator in interface Iterable<Long>
Specified by:
iterator in interface Collection<Long>
Specified by:
iterator in interface Set<Long>
Specified by:
iterator in class AbstractLongCollection
Returns:
a type-specific iterator on the elements of this collection.

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<Long>
Specified by:
equals in interface Set<Long>
Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code for this set. The hash code of a set is computed by summing the hash codes of its elements.

Specified by:
hashCode in interface Collection<Long>
Specified by:
hashCode in interface Set<Long>
Overrides:
hashCode in class Object
Returns:
a hash code for this set.

remove

public boolean remove(long k)
Description copied from interface: LongSet
Removes an element from this set.

Note that the corresponding method of the type-specific collection is rem(). This unfortunate situation is caused by the clash with the similarly named index-based method in the List interface.

Specified by:
remove in interface LongSet
See Also:
Collection.remove(Object)

rem

public boolean rem(long k)
Delegates to remove().

Specified by:
rem in interface LongCollection
Overrides:
rem in class AbstractLongCollection
Parameters:
k - the element to be removed.
Returns:
true if the set was modified.
See Also:
Collection.remove(Object)

remove

public boolean remove(Object o)
Delegates to the corresponding type-specific method.

Specified by:
remove in interface Collection<Long>
Specified by:
remove in interface Set<Long>
Overrides:
remove in class AbstractLongCollection


Copyright © 2011. All Rights Reserved.