|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--lu.cs.co.util.Set
A very simple class for sets. Supports insertions and picking an element from the set. The sets are actually multisets: No checks for duplicates are performed.
For more powerful sets consult the Collection classes of Java 1.2
Set| Constructor Summary | |
Set()
Constructs an empty set. |
|
Set(int size)
Constructs an empty set. |
|
| Method Summary | |
Object |
anyElement()
Removes an element from the set assuming it is nonempty. |
Enumeration |
elements()
Constructs and enumeration of the elements in the set. |
void |
insert(Object o)
Inserts a given element into the set. |
boolean |
isEmpty()
|
int |
size()
Returns this set's cardinality (number of elements): |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Set()
public Set(int size)
size - an estimate of the maximium size of the set.| Method Detail |
public void insert(Object o)
the - given elementpublic boolean isEmpty()
public Object anyElement()
public Enumeration elements()
Enumerationpublic int size()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||