|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ksu.cis.viewer.AATree
An immutable AA tree that can draw itself. An AA tree is a binary search tree such that if it is nonempty, the level of a node is 1 if the node is a leaf, the node is red if it is the same level as its parent, and the node is black if it is one level less than the level of the parent.
Constructor Summary | |
AATree()
Constructs an empty AA Tree. |
Method Summary | |
Object |
clone()
Returns a clone of this tree. |
JComponent |
getDrawing()
Returns a drawing of the tree. |
JComponent |
getDrawing(Font fnt)
Returns a drawing of the tree using the given Font. |
BSTInterface |
put(String key)
Returns the AATree resulting from the insertion key into this AATree. |
BSTInterface |
remove(String key)
Returns the AATree resulting from the removal of key from this AATree. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AATree()
Method Detail |
public BSTInterface put(String key) throws NullPointerException
put
in interface BSTInterface
NullPointerException
- If keynullpublic BSTInterface remove(String key) throws NullPointerException
remove
in interface BSTInterface
NullPointerException
- If key is nullpublic JComponent getDrawing()
getDrawing
in interface BSTInterface
public JComponent getDrawing(Font fnt)
getDrawing
in interface BSTInterface
NullPointerException
- if fnt is null.public Object clone()
clone
in interface BSTInterface
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |