Java-Set Source Code Analysis

Source: Internet
Author: User

Java-Set Source Code Analysis
Set is also inherited from Collection, and set is also a set, and Set does not allow repeated elements to exist.
Set Source Code:

Public interface Set
 
  
Extends Collection
  
   
{Int size (); // boolean isEmpty (); // whether it is null boolean contains (Object o); // whether it contains an Object Iterator
   
    
Iterator (); // generates the iterator Object [] toArray (); // returns the Object Array
    
     
T [] toArray (T [] a); // returns the Generic Array boolean add (E e); // adds the element boolean remove (Object o) to the set ); // delete an element boolean containsAll (Collection
     C); // whether a Collection is included in this lset boolean addAll (Collection
     C); // append a Collection to this set boolean retainAll (Collection
     C); // Delete the element boolean removeAll (Collection
     C); // Delete the element void clear () contained in this Collection; // clear set boolean equals (Object o); // determine whether the two sets are the same int hashCode (); // calculate the hashCode @ Override default Spliterator of the set.
     
      
Spliterator () {return Spliterators. spliterator (this, Spliterator. DISTINCT );}}
     
    
   
  
 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.