public class SMOset
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
SMOset(int size)
Creates a new set of the given size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int index)
Checks whether an element is in the set.
|
void |
delete(int index)
Deletes an element from the set.
|
java.lang.String |
elmentsToString()
Prints all the current elements in the set.
|
int |
getNext(int index)
Gets the next element in the set. -1 gets the first one.
|
void |
insert(int index)
Inserts an element into the set.
|
int |
numElements()
Returns the number of elements in the set.
|
void |
printElements()
Prints all the current elements in the set.
|
public SMOset(int size)
size
- size of the set.public boolean contains(int index)
index
- given index.public void delete(int index)
index
- given index.public void insert(int index)
index
- given index.public int getNext(int index)
index
- given indexpublic void printElements()
public java.lang.String elmentsToString()
public int numElements()