|
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 capacityMethod Detail |
---|
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface Set
iterator
in class AbstractCollection
Collection.iterator()
public int size()
size
in interface Collection
size
in interface Set
size
in class AbstractCollection
Collection.size()
public boolean isEmpty()
true
if this set contains no elements.
isEmpty
in interface Collection
isEmpty
in interface Set
isEmpty
in class AbstractCollection
Collection.isEmpty()
public boolean contains(Object o)
true
if this set contains the specified element.
contains
in interface Collection
contains
in interface Set
contains
in class AbstractCollection
o
- 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 Collection
add
in interface Set
add
in class AbstractCollection
o
- element to be added to this set
true
if this set did not already contain o
Collection.add(java.lang.Object)
public boolean remove(Object o)
remove
in interface Collection
remove
in interface Set
remove
in class AbstractCollection
o
- the element to remove
true
if o
was in this setCollection.remove(java.lang.Object)
public void clear()
clear
in interface Collection
clear
in interface Set
clear
in class AbstractCollection
Collection.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 |