it.unimi.dsi.fastutil.bytes
Class AbstractByteSet

java.lang.Object
  extended by java.util.AbstractCollection<Byte>
      extended by it.unimi.dsi.fastutil.bytes.AbstractByteCollection
          extended by it.unimi.dsi.fastutil.bytes.AbstractByteSet
All Implemented Interfaces:
ByteCollection, ByteIterable, ByteSet, Cloneable, Iterable<Byte>, Collection<Byte>, Set<Byte>
Direct Known Subclasses:
AbstractByteSortedSet, ByteArraySet, ByteOpenCustomHashSet, ByteOpenHashSet, ByteSets.Singleton

public abstract class AbstractByteSet
extends AbstractByteCollection
implements Cloneable, ByteSet

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


Method Summary
 boolean equals(Object o)
           
 int hashCode()
          Returns a hash code for this set.
abstract  ByteIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 boolean rem(byte k)
          Delegates to remove().
 boolean remove(byte 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.bytes.AbstractByteCollection
add, add, addAll, addAll, byteIterator, contains, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toByteArray, toByteArray, toString
 
Methods inherited from class java.util.AbstractCollection
clear, size
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection
add, addAll, byteIterator, contains, containsAll, removeAll, retainAll, toArray, toArray, toByteArray, toByteArray
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Method Detail

iterator

public abstract ByteIterator iterator()
Description copied from interface: ByteCollection
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 ByteCollection
Specified by:
iterator in interface ByteIterable
Specified by:
iterator in interface ByteSet
Specified by:
iterator in interface Iterable<Byte>
Specified by:
iterator in interface Collection<Byte>
Specified by:
iterator in interface Set<Byte>
Specified by:
iterator in class AbstractByteCollection
Returns:
a type-specific iterator on the elements of this collection.

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<Byte>
Specified by:
equals in interface Set<Byte>
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<Byte>
Specified by:
hashCode in interface Set<Byte>
Overrides:
hashCode in class Object
Returns:
a hash code for this set.

remove

public boolean remove(byte k)
Description copied from interface: ByteSet
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 ByteSet
See Also:
Collection.remove(Object)

rem

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

Specified by:
rem in interface ByteCollection
Overrides:
rem in class AbstractByteCollection
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<Byte>
Specified by:
remove in interface Set<Byte>
Overrides:
remove in class AbstractByteCollection