|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.alias.util.BriggsSet
Set of unsigned integers implemented using two arrays. It has constant time performance for search, insertion, deletion, and initialization (emptying) operations. Scanning all the elements takes time proportional to the size of the set. The largest integer (plus 1) that can enter the set has to be specified when instatiating this class, and the instatiation itself takes time proportional to the number specified.
| Constructor Summary | |
BriggsSet(int pSize)
Creates a new instance of BriggsSet |
|
| Method Summary | |
boolean |
deleteElement(int pElem)
Tries to delete the given element from this set. |
boolean |
findElement(int pElem)
Searches for the given element. |
boolean |
insertElement(int pElem)
Tries to insert the given element into this set. |
void |
makeSetEmpty()
Initializes the set. |
Scanner |
scanner()
Returns the scanner that iterates through this set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BriggsSet(int pSize)
pSize - the grand upper size, or the largest number
that can enter the set plus one.| Method Detail |
public void makeSetEmpty()
public boolean findElement(int pElem)
pElem - the element to search for.
public boolean insertElement(int pElem)
pElem - the element to insert.
public boolean deleteElement(int pElem)
pElem - the element to delete.
public Scanner scanner()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||