T - type of elementspublic class RedBlackTreeLong<T> extends Object implements Sorted.AssociatedWithLong<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
RedBlackTreeLong.Node<T>
Node in the RedBlackTree.
|
Sorted.AssociatedWithInteger<T>, Sorted.AssociatedWithLong<T>| Constructor and Description |
|---|
RedBlackTreeLong() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long value,
T element)
Add an element.
|
void |
clear()
Clear this collection.
|
boolean |
contains(long value,
T element)
Returns true if the given key exists in the tree and its associated value is the given element.
|
boolean |
containsInstance(long value,
T instance)
Returns true if the given key exists in the tree and its associated value is the given element.
|
boolean |
containsKey(long value)
Returns true if the given key exists in the tree.
|
RedBlackTreeLong.Node<T> |
get(long value)
Returns the node associated to the given key, or null if no such key exists.
|
RedBlackTreeLong.Node<T> |
getMax() |
RedBlackTreeLong.Node<T> |
getMin() |
RedBlackTreeLong.Node<T> |
getNext(long value)
Returns the node containing the key just before the given key.
|
RedBlackTreeLong.Node<T> |
getNext(RedBlackTreeLong.Node<T> node)
Returns the node containing the key just before the key of the given node.
|
RedBlackTreeLong.Node<T> |
getPrevious(long value)
Returns the node containing the key just before the given key.
|
RedBlackTreeLong.Node<T> |
getPrevious(RedBlackTreeLong.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<RedBlackTreeLong.Node<T>> |
nodeIterator() |
Iterator<RedBlackTreeLong.Node<T>> |
nodeIteratorOrdered() |
Iterator<RedBlackTreeLong.Node<T>> |
nodeIteratorReverse() |
Iterator<T> |
orderedIterator()
Return an iterator that iterates on the correct order.
|
void |
remove(long key,
T element)
Remove the node containing the given key and element.
|
void |
remove(RedBlackTreeLong.Node<T> node)
Remove the given node.
|
void |
removeInstance(long key,
T instance)
Remove the node containing the given key and element.
|
void |
removeKey(long 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.
|
RedBlackTreeLong.Node<T> |
searchNearestHigher(long value,
boolean acceptEquals)
Returns the node containing the lowest value strictly higher than the given one.
|
RedBlackTreeLong.Node<T> |
searchNearestLower(long 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 RedBlackTreeLong.Node<T> get(long value)
public RedBlackTreeLong.Node<T> getPrevious(long value)
public RedBlackTreeLong.Node<T> getPrevious(RedBlackTreeLong.Node<T> node)
public RedBlackTreeLong.Node<T> getNext(long value)
public RedBlackTreeLong.Node<T> getNext(RedBlackTreeLong.Node<T> node)
public boolean containsKey(long value)
public boolean contains(long value,
T element)
contains in interface Sorted.AssociatedWithLong<T>public boolean containsInstance(long value,
T instance)
containsInstance in interface Sorted.AssociatedWithLong<T>public RedBlackTreeLong.Node<T> getMin()
public RedBlackTreeLong.Node<T> getMax()
public RedBlackTreeLong.Node<T> searchNearestLower(long value, boolean acceptEquals)
public RedBlackTreeLong.Node<T> searchNearestHigher(long value, boolean acceptEquals)
public void add(long value,
T element)
Sorted.AssociatedWithLongadd in interface Sorted.AssociatedWithLong<T>public void removeMin()
public void removeMax()
public void remove(RedBlackTreeLong.Node<T> node)
public void remove(long key,
T element)
remove in interface Sorted.AssociatedWithLong<T>public void removeKey(long key)
public void removeInstance(long key,
T instance)
removeInstance in interface Sorted.AssociatedWithLong<T>public Iterator<RedBlackTreeLong.Node<T>> nodeIterator()
public Iterator<RedBlackTreeLong.Node<T>> nodeIteratorOrdered()
public Iterator<RedBlackTreeLong.Node<T>> nodeIteratorReverse()
public Iterator<T> orderedIterator()
SortedorderedIterator in interface Sorted<T>Copyright © 2019. All rights reserved.