|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Set
This interface defines a mathematical set. The name duplicates the java.util.Set and shares much the same intent although this class is meant to have the genuine meaning. You may use this interface to define finite or infinite sets.
| Method Summary | |
|---|---|
int |
cardinality()
Returns the number of elements in this set (its cardinality). |
boolean |
contains(java.lang.Object o)
Returns true if this set contains the specified element. |
boolean |
equals(java.lang.Object o)
Compares the specified object with this set for equality. |
int |
hashCode()
Returns the hash code value for this set. |
Set |
intersection(Set set)
Performs the intersection of this set with another. |
boolean |
isEmpty()
Returns true if this set contains no elements. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this set (optional operation, as it is meaningless for infinite sets). |
boolean |
remove(java.lang.Object o)
Removes the specified element from this set if it is present (optional operation). |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this set (optional operation, as it is meaningless for infinite sets). |
Set |
union(Set set)
Performs the union of this set with another. |
| Method Detail |
|---|
int cardinality()
boolean isEmpty()
java.util.Iterator iterator()
Set union(Set set)
set - a set.
Set intersection(Set set)
set - a set.
boolean remove(java.lang.Object o)
o - - object to be removed from this set, if present.
boolean contains(java.lang.Object o)
o - - element whose presence in this set is to be tested.
boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - - Object to be compared for equality with this set.
int hashCode()
hashCode in class java.lang.Objectjava.lang.Object[] toArray()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||