public interface ISet extends Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(int element)
Add element to the set
Does not guaranty there is no duplications
|
void |
clear()
Remove all elements from the set
|
boolean |
contain(int element)
Test the existence of element in the set
|
int |
getFirstElement() |
int |
getMaxSize()
Gets the maximum size of the set, or -1 if it is unbounded.
|
int |
getNextElement()
enables to iterate over the set
should be used as follow :
for(int i=getFirstElement(); i>=0; i = getNextElement()){
...
}
The use of getFirstElement() is necessary to ensure a complete iteration
WARNING cannot encapsulate two for loops (copy the set for that)
|
SetType |
getSetType() |
int |
getSize() |
boolean |
isEmpty() |
boolean |
remove(int element)
Remove the first occurence of element from the set
|
int[] |
toArray()
Copies the set in an array if integers
|
boolean add(int element)
element
- element to addboolean remove(int element)
element
- element to addboolean contain(int element)
element
- element to addboolean isEmpty()
int getSize()
void clear()
int getFirstElement()
int getNextElement()
SetType getSetType()
int[] toArray()
int getMaxSize()
Copyright © 2015. All rights reserved.