T - type of elementspublic class RedBlackTreeInteger<T> extends Object implements Sorted.AssociatedWithInteger<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
RedBlackTreeInteger.Node<T>
Node in the RedBlackTree.
|
Sorted.AssociatedWithInteger<T>, Sorted.AssociatedWithLong<T>| Constructor and Description |
|---|
RedBlackTreeInteger() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int value,
T element)
Add an element.
|
void |
clear()
Clear this collection.
|
boolean |
contains(int value,
T element)
Returns true if the given key exists in the tree and its associated value is the given element.
|
boolean |
containsInstance(int value,
T instance)
Returns true if the given key exists in the tree and its associated value is the given element.
|
boolean |
containsKey(int value)
Returns true if the given key exists in the tree.
|
RedBlackTreeInteger.Node<T> |
get(int value)
Returns the node associated to the given key, or null if no such key exists.
|
RedBlackTreeInteger.Node<T> |
getMax() |
RedBlackTreeInteger.Node<T> |
getMin() |
RedBlackTreeInteger.Node<T> |
getNext(int value)
Returns the node containing the key just before the given key.
|
RedBlackTreeInteger.Node<T> |
getNext(RedBlackTreeInteger.Node<T> node)
Returns the node containing the key just before the key of the given node.
|
RedBlackTreeInteger.Node<T> |
getPrevious(int value)
Returns the node containing the key just before the given key.
|
RedBlackTreeInteger.Node<T> |
getPrevious(RedBlackTreeInteger.Node<T> node)
Returns the node containing the key just before the key of the given node.
|
boolean |
isEmpty()
Return true if this collection is empty.
|
Iterator<T> |
iterator() |
Iterator<RedBlackTreeInteger.Node<T>> |
nodeIterator() |
Iterator<RedBlackTreeInteger.Node<T>> |
nodeIteratorOrdered() |
Iterator<RedBlackTreeInteger.Node<T>> |
nodeIteratorReverse() |
Iterator<T> |
orderedIterator()
Return an iterator that iterates on the correct order.
|
void |
remove(int key,
T element)
Remove the node containing the given key and element.
|
void |
remove(RedBlackTreeInteger.Node<T> node)
Remove the given node.
|
void |
removeInstance(int key,
T instance)
Remove the node containing the given key and element.
|
void |
removeKey(int key)
Remove the given key.
|
void |
removeMax()
Remove the last element.
|
void |
removeMin()
Remove the first element.
|
Iterator<T> |
reverseOrderIterator()
Return an iterator that iterates on the correct order.
|
RedBlackTreeInteger.Node<T> |
searchNearestHigher(int value,
boolean acceptEquals)
Returns the node containing the lowest value strictly higher than the given one.
|
RedBlackTreeInteger.Node<T> |
searchNearestLower(int value,
boolean acceptEquals)
Returns the node containing the highest value strictly lower than the given one.
|
int |
size()
Number of elements in this collection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic int size()
Sortedpublic boolean isEmpty()
Sortedpublic void clear()
Sortedpublic RedBlackTreeInteger.Node<T> get(int value)
public RedBlackTreeInteger.Node<T> getPrevious(int value)
public RedBlackTreeInteger.Node<T> getPrevious(RedBlackTreeInteger.Node<T> node)
public RedBlackTreeInteger.Node<T> getNext(int value)
public RedBlackTreeInteger.Node<T> getNext(RedBlackTreeInteger.Node<T> node)
public boolean containsKey(int value)
public boolean contains(int value,
T element)
contains in interface Sorted.AssociatedWithInteger<T>public boolean containsInstance(int value,
T instance)
containsInstance in interface Sorted.AssociatedWithInteger<T>public RedBlackTreeInteger.Node<T> getMin()
public RedBlackTreeInteger.Node<T> getMax()
public RedBlackTreeInteger.Node<T> searchNearestLower(int value, boolean acceptEquals)
public RedBlackTreeInteger.Node<T> searchNearestHigher(int value, boolean acceptEquals)
public void add(int value,
T element)
Sorted.AssociatedWithIntegeradd in interface Sorted.AssociatedWithInteger<T>public void removeMin()
public void removeMax()
public void remove(RedBlackTreeInteger.Node<T> node)
public void remove(int key,
T element)
remove in interface Sorted.AssociatedWithInteger<T>public void removeKey(int key)
public void removeInstance(int key,
T instance)
removeInstance in interface Sorted.AssociatedWithInteger<T>public Iterator<RedBlackTreeInteger.Node<T>> nodeIterator()
public Iterator<RedBlackTreeInteger.Node<T>> nodeIteratorOrdered()
public Iterator<RedBlackTreeInteger.Node<T>> nodeIteratorReverse()
public Iterator<T> orderedIterator()
SortedorderedIterator in interface Sorted<T>Copyright © 2019. All rights reserved.