public class TwoThreeNode extends TreeNode
Constructor and Description |
---|
TwoThreeNode(java.lang.String keyType)
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
TwoThreeNode |
CenterChild()
Getter for center child.
|
void |
CenterChild(TwoThreeNode centerChild)
Setter for center child.
|
NodeData |
CenterKey()
Getter for center key.
|
void |
CenterKey(NodeData centerKey)
Setter for center key.
|
int |
compareKeys(TwoThreeNode compareNode)
Compares key of proper type between nodes.
|
protected int |
ConvertHexToDec(java.lang.String hexValue)
Converts a hex value to a standard base10 decimal.
|
int |
CountDirectChildren()
Counts number of direct children node has.
|
NodeData |
CreateData(java.lang.String ascii,
int dec,
java.lang.String hex,
int oct)
Creates new ascii data object for node.
|
NodeData |
Data()
Getter for node data.
|
void |
Data(NodeData data)
Setter for node data.
|
TwoThreeNode |
Duplicate(TwoThreeNode node)
Duplicates node.
|
boolean |
IsLeaf()
Getter for leaf bool.
|
void |
IsLeaf(boolean isLeaf)
Setter for leaf bool.
|
TwoThreeNode |
LeftChild()
Getter for left child.
|
void |
LeftChild(TwoThreeNode leftChild)
Setter for left child.
|
NodeData |
LeftKey()
Getter for left key.
|
void |
LeftKey(NodeData leftKey)
Setter for left key.
|
TwoThreeNode |
ParentNode()
Getter for parent node.
|
void |
ParentNode(TwoThreeNode parentNode)
Setter for parent node.
|
TwoThreeNode |
RightChild()
Getter for right child.
|
void |
RightChild(TwoThreeNode rightChild)
Setter for right child.
|
NodeData |
RightKey()
Getter for right key.
|
void |
RightKey(NodeData rightKey)
Setter for right key.
|
public TwoThreeNode(java.lang.String keyType)
keyType
- Key type for node.public boolean IsLeaf()
public void IsLeaf(boolean isLeaf)
isLeaf
- Bool indicating if node is leaf.public NodeData Data()
public void Data(NodeData data)
data
- Data values if node is leaf.public NodeData LeftKey()
public void LeftKey(NodeData leftKey)
leftKey
- Key struct for left subtree.public NodeData CenterKey()
public void CenterKey(NodeData centerKey)
centerKey
- Key struct for center subtree.public NodeData RightKey()
public void RightKey(NodeData rightKey)
rightKey
- Key struct for right subtree.public TwoThreeNode LeftChild()
public void LeftChild(TwoThreeNode leftChild)
leftChild
- Root node of left subtree.public TwoThreeNode CenterChild()
public void CenterChild(TwoThreeNode centerChild)
centerChild
- Root node of center subtree.public TwoThreeNode RightChild()
public void RightChild(TwoThreeNode rightChild)
rightChild
- Root node of right subtree.public TwoThreeNode ParentNode()
public void ParentNode(TwoThreeNode parentNode)
parentNode
- Node parent.public NodeData CreateData(java.lang.String ascii, int dec, java.lang.String hex, int oct)
ascii
- Actual ascii character.dec
- Decimal value for ascii character.hex
- Hex value for ascii character.oct
- Octal value for ascii character.public TwoThreeNode Duplicate(TwoThreeNode node)
node
- Node to duplicate.public int compareKeys(TwoThreeNode compareNode)
compareNode
- Node to compare.public int CountDirectChildren()
protected int ConvertHexToDec(java.lang.String hexValue)
hexValue
- Value to convert.