it.unimi.dsi.fastutil.bytes
Class AbstractByteSet

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

public abstract class AbstractByteSet
extends AbstractByteCollection
implements java.lang.Cloneable, ByteSet

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


Method Summary
 boolean equals(java.lang.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(java.lang.Object o)
          Delegates to the corresponding type-specific method.
 
Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
add, add, addAll, addAll, byteIterator, clear, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toByteArray, toByteArray, toString
 
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 java.lang.Iterable<java.lang.Byte>
Specified by:
iterator in interface java.util.Collection<java.lang.Byte>
Specified by:
iterator in interface java.util.Set<java.lang.Byte>
Specified by:
iterator in class AbstractByteCollection
Returns:
a type-specific iterator on the elements of this collection.

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection<java.lang.Byte>
Specified by:
equals in interface java.util.Set<java.lang.Byte>
Overrides:
equals in class java.lang.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 java.util.Collection<java.lang.Byte>
Specified by:
hashCode in interface java.util.Set<java.lang.Byte>
Overrides:
hashCode in class java.lang.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(java.lang.Object o)
Delegates to the corresponding type-specific method.

Specified by:
remove in interface java.util.Collection<java.lang.Byte>
Specified by:
remove in interface java.util.Set<java.lang.Byte>
Overrides:
remove in class AbstractByteCollection