Class AbstractByteSet

    • Method Detail

      • 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)
        Removes an element from this set.

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

        Specified by:
        remove in interface ByteSet
        See Also:
        Collection.remove(Object)
      • rem

        @Deprecated
        public boolean rem​(byte k)
        Deprecated.
        Please use remove() instead.
        Removes a single instance of the specified element from this collection, if it is present (optional operation).

        Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name. For simplicity, the set interfaces reinstates remove().

        This implementation iterates over the elements in the collection, looking for the specified element and tries to remove it. Delegates to the type-specific remove() method specified in the type-specific Set interface.

        Specified by:
        rem in interface ByteCollection
        Specified by:
        rem in interface ByteSet
        Overrides:
        rem in class AbstractByteCollection
        See Also:
        Collection.remove(Object)