|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ksu.cis.viewer.Node
The objects used as the nodes of trees in the BinaryTree class. The contents of a Node are represented by a String. In addition, each Node has an int tag and a color. A Node is immutable.
BinaryTree
Constructor Summary | |
Node(String s)
Constructs a black Node with the given contents and a tag of 0. |
|
Node(String s,
Color col)
Constructs a Node of the given color with the given contents and a tag of 0. |
|
Node(String s,
int tag)
Constructs a black Node with the given contents and tag. |
|
Node(String s,
int tag,
Color col)
Constructs a Node of the given color with the given contents and tag. |
Method Summary | |
Object |
clone()
Because this structure is immutable, this method simply returns the node itself. |
Color |
getColor()
Returns the color of the Node. |
String |
getContents()
Returns the contents of the Node. |
int |
getTag()
Returns the tag of the Node. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Node(String s) throws NullPointerException
NullPointerException
- if s is nullpublic Node(String s, int tag) throws NullPointerException
s
- the contents of the Nodetag
- the tag
NullPointerException
- if s is nullpublic Node(String s, Color col) throws NullPointerException
s
- the contents of the Nodecol
- the color of the Node
NullPointerException
- if either s or col is
nullpublic Node(String s, int tag, Color col) throws NullPointerException
s
- the contents of the Nodetag
- the tagcol
- the color of the Node
NullPointerException
- if either s or col is
nullMethod Detail |
public String getContents()
public int getTag()
public Color getColor()
public Object clone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |