AbstractSetE


AbstractSet<E> java.util

Java 1.2 collection

This abstract class is a partial implementation of the Set interface that makes it easy to create custom Set implementations . Since Set defines the same methods as Collection , you can subclass AbstractSet exactly as you would subclass AbstractCollection . See AbstractCollection for details. Note, however, that when subclassing AbstractSet , you should be sure that your add( ) method and your constructors do not allow duplicate elements to be added to the set. See also AbstractList .

Figure 16-6. java.util.AbstractSet<E>

 public abstract class  AbstractSet<E>  extends AbstractCollection<E> implements Set<E> {  // Protected Constructors  protected  AbstractSet  ( );  // Methods Implementing Set  public boolean  equals  (Object  o  );        public int  hashCode  ( );  1.3  public boolean  removeAll  (Collection<?>  c  );   } 

Subclasses

EnumSet , HashSet , treeSet , java.util.concurrent.CopyOnWriteArraySet



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net