Public Methods | |
GenericSet () | |
GenericSet (Object e) | |
GenericSet (Vector v) | |
void | addElemToSet (Object ele) |
boolean | contains (Object e) |
GenericSet | difference (GenericSet s) |
boolean | equals (GenericSet another) |
GenericSet | intersect (GenericSet s) |
void | remove (Object ele) |
Object | setRef (int i) |
int | size () |
String | toString () |
GenericSet | union (GenericSet s) |
Static Public Methods | |
void | main (String args[]) |
Private Attributes | |
Vector | set |
Definition at line 50 of file GenericSet.java.
|
Creates a new empty set. Definition at line 57 of file GenericSet.java. Referenced by difference(), intersect(), and union().
|
|
Creates a new set with a single element.
Definition at line 66 of file GenericSet.java. |
|
Checks if an element is in the set.
Definition at line 86 of file GenericSet.java. Referenced by difference(), intersect(), and union().
|
|
Finds the difference between two sets.
Definition at line 95 of file GenericSet.java. |
|
Intersects another set together.
Definition at line 133 of file GenericSet.java. |
|
Gets the ith element from the set.
Definition at line 174 of file GenericSet.java. |
|
Returns the number of elements in the set.
Definition at line 183 of file GenericSet.java. Referenced by union().
|
|
Converts the set to a string
Definition at line 192 of file GenericSet.java. |
|
Unions another set together.
Definition at line 201 of file GenericSet.java. |