|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.colorado.collections.IntBalancedSet
public class IntBalancedSet
This class is a homework assignment;
An IntBalancedSet is a set of int numbers, stored in a B-tree.
IntArrayBag,
IntLinkedBag,
IntTreeBag| Constructor Summary | |
|---|---|
IntBalancedSet()
Initialize an empty set. |
|
| Method Summary | |
|---|---|
void |
add(int element)
Add a new element to this set. |
java.lang.Object |
clone()
Generate a copy of this set. |
boolean |
contains(int target)
Accessor method to determine whether a particular element is in this set. |
void |
print(int indent)
|
boolean |
remove(int target)
Remove a specified element from this set. |
void |
transferLeft(int i)
|
void |
transferRight(int i)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IntBalancedSet()
- - none
java.lang.OutOfMemoryError - Indicates insufficient memory for adding a new element.| Method Detail |
|---|
public void add(int element)
element - the new element that is being added
java.lang.OutOfMemoryError - Indicates insufficient memory for adding a new element.public java.lang.Object clone()
clone in class java.lang.Object- - none
IntBalancedSet before it
can be used.
java.lang.OutOfMemoryError - Indicates insufficient memory for creating the clone.public boolean contains(int target)
target - an element that may or may not be in this set
true if this set contains target;
otherwise falsepublic boolean remove(int target)
target - the element to remove from this set
target was found in this set, then it has been removed
and the method returns true. Otherwise this set remains
unchanged and the method returns false.public void print(int indent)
public void transferLeft(int i)
public void transferRight(int i)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||