com.github.andrewoma.dexx.collection.internal.redblack
Class RedBlackTree<K,V>

java.lang.Object
  extended by com.github.andrewoma.dexx.collection.internal.redblack.RedBlackTree<K,V>

public class RedBlackTree<K,V>
extends Object


Constructor Summary
RedBlackTree()
           
RedBlackTree(TreeFactory factory, Comparator<? super K> ordering, KeyFunction<K,V> keyFunction)
           
 
Method Summary
 Tree<K,V> append(Tree<K,V> tl, Tree<K,V> tr)
           
 boolean contains(Tree<K,V> tree, K x)
           
static int count(Tree<?,?> tree)
           
 Tree<K,V> delete(Tree<K,V> tree, K k)
           
 Tree<K,V> drop(Tree<K,V> tree, int n)
           
<U> void
forEach(Tree<K,V> tree, Function<Pair<K,V>,U> f)
           
 Tree<K,V> from(Tree<K,V> tree, K from, boolean inclusive)
           
 V get(Tree<K,V> tree, K x)
           
 KeyFunction<K,V> getKeyFunction()
           
 Comparator<? super K> getOrdering()
           
 Tree<K,V> greatest(Tree<K,V> tree)
           
 boolean isEmpty(Tree<K,V> tree)
           
 Iterator<Pair<K,V>> iterator(Tree<K,V> tree)
           
 Iterator<K> keysIterator(Tree<K,V> tree)
           
 Tree<K,V> lookup(Tree<K,V> tree, K x)
           
 Tree<K,V> range(Tree<K,V> tree, K from, boolean fromInclusive, K until, boolean untilInclusive)
           
 Tree<K,V> slice(Tree<K,V> tree, int from, int until)
           
 Tree<K,V> smallest(Tree<K,V> tree)
           
 Tree<K,V> take(Tree<K,V> tree, int n)
           
 Tree<K,V> until(Tree<K,V> tree, K key, boolean inclusive)
           
 Tree<K,V> update(Tree<K,V> tree, K k, V v, boolean overwrite)
           
 Iterator<V> valuesIterator(Tree<K,V> tree)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedBlackTree

public RedBlackTree()

RedBlackTree

public RedBlackTree(TreeFactory factory,
                    Comparator<? super K> ordering,
                    KeyFunction<K,V> keyFunction)
Method Detail

getKeyFunction

public KeyFunction<K,V> getKeyFunction()

getOrdering

public Comparator<? super K> getOrdering()

isEmpty

public boolean isEmpty(Tree<K,V> tree)

contains

public boolean contains(Tree<K,V> tree,
                        K x)

get

public V get(Tree<K,V> tree,
             K x)

lookup

public Tree<K,V> lookup(Tree<K,V> tree,
                        K x)

count

public static int count(Tree<?,?> tree)

update

public Tree<K,V> update(Tree<K,V> tree,
                        K k,
                        V v,
                        boolean overwrite)

delete

public Tree<K,V> delete(Tree<K,V> tree,
                        K k)

range

public Tree<K,V> range(Tree<K,V> tree,
                       K from,
                       boolean fromInclusive,
                       K until,
                       boolean untilInclusive)

from

public Tree<K,V> from(Tree<K,V> tree,
                      K from,
                      boolean inclusive)

until

public Tree<K,V> until(Tree<K,V> tree,
                       K key,
                       boolean inclusive)

drop

public Tree<K,V> drop(Tree<K,V> tree,
                      int n)

take

public Tree<K,V> take(Tree<K,V> tree,
                      int n)

slice

public Tree<K,V> slice(Tree<K,V> tree,
                       int from,
                       int until)

smallest

public Tree<K,V> smallest(Tree<K,V> tree)

greatest

public Tree<K,V> greatest(Tree<K,V> tree)

forEach

public <U> void forEach(Tree<K,V> tree,
                        Function<Pair<K,V>,U> f)

iterator

public Iterator<Pair<K,V>> iterator(Tree<K,V> tree)

keysIterator

public Iterator<K> keysIterator(Tree<K,V> tree)

valuesIterator

public Iterator<V> valuesIterator(Tree<K,V> tree)

append

public Tree<K,V> append(Tree<K,V> tl,
                        Tree<K,V> tr)


Copyright © 2014. All Rights Reserved.