IT. Expert System.

Android Reference

Set


java.util

Interface Set<E>

    • Method Summary

      Methods
      Modifier and Type Method and Description
      boolean add(E object)
      Adds the specified object to this set.
      boolean addAll(Collection<? extends E> collection)
      Adds the objects in the specified collection which do not exist yet in this set.
      void clear()
      Removes all elements from this set, leaving it empty.
      boolean contains(Object object)
      Searches this set for the specified object.
      boolean containsAll(Collection<?> collection)
      Searches this set for all objects in the specified collection.
      boolean equals(Object object)
      Compares the specified object to this set, and returns true if they represent the same object using a class specific comparison.
      int hashCode()
      Returns the hash code for this set.
      boolean isEmpty()
      Returns true if this set has no elements.
      Iterator<E> iterator()
      Returns an iterator on the elements of this set.
      boolean remove(Object object)
      Removes the specified object from this set.
      boolean removeAll(Collection<?> collection)
      Removes all objects in the specified collection from this set.
      boolean retainAll(Collection<?> collection)
      Removes all objects from this set that are not contained in the specified collection.
      int size()
      Returns the number of elements in this set.
      Object[] toArray()
      Returns an array containing all elements contained in this set.
      <T> T[] toArray(T[] array)
      Returns an array containing all elements contained in this set.
    • Method Detail

      • add

        boolean add(E object)
        Adds the specified object to this set. The set is not modified if it already contains the object.
        Specified by:
        add in interface Collection<E>
        Parameters:
        object - the object to add.
        Returns:
        true if this set is modified, false otherwise.
        Throws:
        UnsupportedOperationException - when adding to this set is not supported.
        ClassCastException - when the class of the object is inappropriate for this set.
        IllegalArgumentException - when the object cannot be added to this set.
      • addAll

        boolean addAll(Collection<? extends E> collection)
        Adds the objects in the specified collection which do not exist yet in this set.
        Specified by:
        addAll in interface Collection<E>
        Parameters:
        collection - the collection of objects.
        Returns:
        true if this set is modified, false otherwise.
        Throws:
        UnsupportedOperationException - when adding to this set is not supported.
        ClassCastException - when the class of an object is inappropriate for this set.
        IllegalArgumentException - when an object cannot be added to this set.
      • contains

        boolean contains(Object object)
        Searches this set for the specified object.
        Specified by:
        contains in interface Collection<E>
        Parameters:
        object - the object to search for.
        Returns:
        true if object is an element of this set, false otherwise.
      • containsAll

        boolean containsAll(Collection<?> collection)
        Searches this set for all objects in the specified collection.
        Specified by:
        containsAll in interface Collection<E>
        Parameters:
        collection - the collection of objects.
        Returns:
        true if all objects in the specified collection are elements of this set, false otherwise.
      • equals

        boolean equals(Object object)
        Compares the specified object to this set, and returns true if they represent the same object using a class specific comparison. Equality for a set means that both sets have the same size and the same elements.
        Specified by:
        equals in interface Collection<E>
        Overrides:
        equals in class Object
        Parameters:
        object - the object to compare with this object.
        Returns:
        boolean true if the object is the same as this object, and false if it is different from this object.
        See Also:
        hashCode()
      • isEmpty

        boolean isEmpty()
        Returns true if this set has no elements.
        Specified by:
        isEmpty in interface Collection<E>
        Returns:
        true if this set has no elements, false otherwise.
        See Also:
        size()
      • iterator

        Iterator<E> iterator()
        Returns an iterator on the elements of this set. The elements are unordered.
        Specified by:
        iterator in interface Collection<E>
        Specified by:
        iterator in interface Iterable<E>
        Returns:
        an iterator on the elements of this set.
        See Also:
        Iterator
      • remove

        boolean remove(Object object)
        Removes the specified object from this set.
        Specified by:
        remove in interface Collection<E>
        Parameters:
        object - the object to remove.
        Returns:
        true if this set was modified, false otherwise.
        Throws:
        UnsupportedOperationException - when removing from this set is not supported.
      • removeAll

        boolean removeAll(Collection<?> collection)
        Removes all objects in the specified collection from this set.
        Specified by:
        removeAll in interface Collection<E>
        Parameters:
        collection - the collection of objects to remove.
        Returns:
        true if this set was modified, false otherwise.
        Throws:
        UnsupportedOperationException - when removing from this set is not supported.
      • retainAll

        boolean retainAll(Collection<?> collection)
        Removes all objects from this set that are not contained in the specified collection.
        Specified by:
        retainAll in interface Collection<E>
        Parameters:
        collection - the collection of objects to retain.
        Returns:
        true if this set was modified, false otherwise.
        Throws:
        UnsupportedOperationException - when removing from this set is not supported.
      • size

        int size()
        Returns the number of elements in this set.
        Specified by:
        size in interface Collection<E>
        Returns:
        the number of elements in this set.
      • toArray

        Object[] toArray()
        Returns an array containing all elements contained in this set.
        Specified by:
        toArray in interface Collection<E>
        Returns:
        an array of the elements from this set.
      • toArray

        <T> T[] toArray(T[] array)
        Returns an array containing all elements contained in this set. If the specified array is large enough to hold the elements, the specified array is used, otherwise an array of the same type is created. If the specified array is used and is larger than this set, the array element following the collection elements is set to null.
        Specified by:
        toArray in interface Collection<E>
        Parameters:
        array - the array.
        Returns:
        an array of the elements from this set.
        Throws:
        ArrayStoreException - when the type of an element in this set cannot be stored in the type of the specified array.
        See Also:
        Collection.toArray(Object[])


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 930 / 96446848. Delta: 0.03318 с