|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet
com.compoze.collab.util.ArraySet
public class ArraySet
A Set implementation backed by an ArrayMap. This class does not permit the
null element. Note that this class is only appropriate for holding
very small sets, as most operations are quadratic time.
| Constructor Summary | |
|---|---|
ArraySet()
Constructs an ArraySet with the default initial capacity (5). |
|
ArraySet(Collection c)
Constructs an ArraySet containing the elements of a collection. |
|
ArraySet(int iInitialCapacity)
Constructs an ArraySet with the specified initial capacity. |
|
| Method Summary | |
|---|---|
boolean |
add(Object o)
Adds the specified element to this set if it is not already present. |
void |
clear()
Remove all the elements from this set |
boolean |
contains(Object o)
Returns true if this set contains the specified element. |
boolean |
isEmpty()
Returns true if this set contains no elements. |
Iterator |
iterator()
Returns an iterator over the elements in this set. |
boolean |
remove(Object o)
Removes the given element from this set if it is present. |
int |
size()
Returns the number of elements in this set. |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, containsAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, containsAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public ArraySet()
public ArraySet(Collection c)
c - the collection whose elements are to be placed into this set.public ArraySet(int iInitialCapacity)
iInitialCapacity - the initial capacity| Method Detail |
|---|
public Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setiterator in class AbstractCollectionCollection.iterator()public int size()
size in interface Collectionsize in interface Setsize in class AbstractCollectionCollection.size()public boolean isEmpty()
true if this set contains no elements.
isEmpty in interface CollectionisEmpty in interface SetisEmpty in class AbstractCollectionCollection.isEmpty()public boolean contains(Object o)
true if this set contains the specified element.
contains in interface Collectioncontains in interface Setcontains in class AbstractCollectiono - element to be tested for membership
true if this set contains the specified element.Collection.contains(java.lang.Object)public boolean add(Object o)
add in interface Collectionadd in interface Setadd in class AbstractCollectiono - element to be added to this set
true if this set did not already contain oCollection.add(java.lang.Object)public boolean remove(Object o)
remove in interface Collectionremove in interface Setremove in class AbstractCollectiono - the element to remove
true if o was in this setCollection.remove(java.lang.Object)public void clear()
clear in interface Collectionclear in interface Setclear in class AbstractCollectionCollection.clear()
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||