static class TreeBidiMap.Node extends java.lang.Object implements java.util.Map.Entry, KeyValue
Modifier and Type | Field and Description |
---|---|
private boolean[] |
blackColor |
private boolean |
calculatedHashCode |
private java.lang.Comparable[] |
data |
private int |
hashcodeValue |
private TreeBidiMap.Node[] |
leftNode |
private TreeBidiMap.Node[] |
parentNode |
private TreeBidiMap.Node[] |
rightNode |
Constructor and Description |
---|
Node(java.lang.Comparable key,
java.lang.Comparable value)
Make a new cell with given key and value, and with null
links, and black (true) colors.
|
Modifier and Type | Method and Description |
---|---|
private void |
copyColor(TreeBidiMap.Node node,
int index)
Make this node the same color as another
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this entry for equality.
|
private java.lang.Comparable |
getData(int index)
Get the specified data.
|
java.lang.Object |
getKey()
Gets the key.
|
private TreeBidiMap.Node |
getLeft(int index)
Get the left node.
|
private TreeBidiMap.Node |
getParent(int index)
Get the parent node.
|
private TreeBidiMap.Node |
getRight(int index)
Get the right node.
|
java.lang.Object |
getValue()
Gets the value.
|
int |
hashCode() |
private boolean |
isBlack(int index)
Is this node black?
|
private boolean |
isRed(int index)
Is this node red?
|
private void |
setBlack(int index)
Make this node black.
|
private void |
setLeft(TreeBidiMap.Node node,
int index)
Set this node's left node.
|
private void |
setParent(TreeBidiMap.Node node,
int index)
Set this node's parent node.
|
private void |
setRed(int index)
Make this node red.
|
private void |
setRight(TreeBidiMap.Node node,
int index)
Set this node's right node.
|
java.lang.Object |
setValue(java.lang.Object ignored)
Optional operation that is not permitted in this implementation
|
private void |
swapColors(TreeBidiMap.Node node,
int index)
Exchange colors with another node.
|
private java.lang.Comparable[] data
private TreeBidiMap.Node[] leftNode
private TreeBidiMap.Node[] rightNode
private TreeBidiMap.Node[] parentNode
private boolean[] blackColor
private int hashcodeValue
private boolean calculatedHashCode
Node(java.lang.Comparable key, java.lang.Comparable value)
key
- value
- private java.lang.Comparable getData(int index)
index
- the KEY or VALUE intprivate void setLeft(TreeBidiMap.Node node, int index)
node
- the new left nodeindex
- the KEY or VALUE intprivate TreeBidiMap.Node getLeft(int index)
index
- the KEY or VALUE intprivate void setRight(TreeBidiMap.Node node, int index)
node
- the new right nodeindex
- the KEY or VALUE intprivate TreeBidiMap.Node getRight(int index)
index
- the KEY or VALUE intprivate void setParent(TreeBidiMap.Node node, int index)
node
- the new parent nodeindex
- the KEY or VALUE intprivate TreeBidiMap.Node getParent(int index)
index
- the KEY or VALUE intprivate void swapColors(TreeBidiMap.Node node, int index)
node
- the node to swap withindex
- the KEY or VALUE intprivate boolean isBlack(int index)
index
- the KEY or VALUE intprivate boolean isRed(int index)
index
- the KEY or VALUE intprivate void setBlack(int index)
index
- the KEY or VALUE intprivate void setRed(int index)
index
- the KEY or VALUE intprivate void copyColor(TreeBidiMap.Node node, int index)
node
- the node whose color we're adoptingindex
- the KEY or VALUE intpublic java.lang.Object getKey()
public java.lang.Object getValue()
public java.lang.Object setValue(java.lang.Object ignored) throws java.lang.UnsupportedOperationException
setValue
in interface java.util.Map.Entry
ignored
- java.lang.UnsupportedOperationException
- alwayspublic boolean equals(java.lang.Object obj)
equals
in interface java.util.Map.Entry
equals
in class java.lang.Object
obj
- the object to be compared for equality with this entry.public int hashCode()
hashCode
in interface java.util.Map.Entry
hashCode
in class java.lang.Object