Class LLRBEmptyNode<K,V> (3.9.6)

public class LLRBEmptyNode<K,V> implements LLRBNode<K,V>

Inheritance

java.lang.Object > LLRBEmptyNode<K,V>

Implements

LLRBNode<K,V>

Type Parameters

NameDescription
K
V

Static Methods

<K,V>getInstance()

public static LLRBEmptyNode<K,V> <K,V>getInstance()
Returns
TypeDescription
LLRBEmptyNode<K,V>

Methods

copy(K key, V value, LLRBNode.Color color, LLRBNode<K,V> left, LLRBNode<K,V> right)

public LLRBNode<K,V> copy(K key, V value, LLRBNode.Color color, LLRBNode<K,V> left, LLRBNode<K,V> right)
Parameters
NameDescription
keyK
valueV
colorLLRBNode.Color
leftLLRBNode<K,V>
rightLLRBNode<K,V>
Returns
TypeDescription
LLRBNode<K,V>

getKey()

public K getKey()
Returns
TypeDescription
K

getLeft()

public LLRBNode<K,V> getLeft()
Returns
TypeDescription
LLRBNode<K,V>

getMax()

public LLRBNode<K,V> getMax()
Returns
TypeDescription
LLRBNode<K,V>

getMin()

public LLRBNode<K,V> getMin()
Returns
TypeDescription
LLRBNode<K,V>

getRight()

public LLRBNode<K,V> getRight()
Returns
TypeDescription
LLRBNode<K,V>

getValue()

public V getValue()
Returns
TypeDescription
V

inOrderTraversal(LLRBNode.NodeVisitor<K,V> visitor)

public void inOrderTraversal(LLRBNode.NodeVisitor<K,V> visitor)
Parameter
NameDescription
visitorNodeVisitor<K,V>

insert(K key, V value, Comparator<K> comparator)

public LLRBNode<K,V> insert(K key, V value, Comparator<K> comparator)
Parameters
NameDescription
keyK
valueV
comparatorComparator<K>
Returns
TypeDescription
LLRBNode<K,V>

isEmpty()

public boolean isEmpty()
Returns
TypeDescription
boolean

isRed()

public boolean isRed()
Returns
TypeDescription
boolean

remove(K key, Comparator<K> comparator)

public LLRBNode<K,V> remove(K key, Comparator<K> comparator)
Parameters
NameDescription
keyK
comparatorComparator<K>
Returns
TypeDescription
LLRBNode<K,V>

shortCircuitingInOrderTraversal(LLRBNode.ShortCircuitingNodeVisitor<K,V> visitor)

public boolean shortCircuitingInOrderTraversal(LLRBNode.ShortCircuitingNodeVisitor<K,V> visitor)
Parameter
NameDescription
visitorShortCircuitingNodeVisitor<K,V>
Returns
TypeDescription
boolean

shortCircuitingReverseOrderTraversal(LLRBNode.ShortCircuitingNodeVisitor<K,V> visitor)

public boolean shortCircuitingReverseOrderTraversal(LLRBNode.ShortCircuitingNodeVisitor<K,V> visitor)
Parameter
NameDescription
visitorShortCircuitingNodeVisitor<K,V>
Returns
TypeDescription
boolean

size()

public int size()
Returns
TypeDescription
int