Send feedback
Class RBTreeSortedMap<K,V> (3.28.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version latest keyboard_arrow_down
public class RBTreeSortedMap<K , V > extends ImmutableSortedMap<K , V >
This is a red-black tree backed implementation of ImmutableSortedMap. This has better asymptotic
complexity for large collections, but performs worse in practice than an ArraySortedMap for small
collections. It also uses about twice as much memory.
Note: This package is copied from https://github.com/firebase/firebase-admin-java/tree/master/
src/main/java/com/google/firebase/database/collection
Type Parameters
Name
Description
K
V
Static Methods
<A,B,C>buildFrom(List<A> keys, Map<B,C> values, ImmutableSortedMap.Builder.KeyTranslator<A,B> translator, Comparator<A> comparator)
public static RBTreeSortedMap<A , C > <A , B , C>buildFrom ( List<A> keys , Map<B , C > values , ImmutableSortedMap . Builder . KeyTranslator<A , B > translator , Comparator<A> comparator )
<A,B>fromMap(Map<A,B> values, Comparator<A> comparator)
public static RBTreeSortedMap<A , B > <A , B>fromMap ( Map<A , B > values , Comparator<A> comparator )
Parameters
Name
Description
values
Map <A ,B >
comparator
Comparator <A >
Methods
containsKey(K key)
public boolean containsKey ( K key )
Parameter
Name
Description
key
K
Overrides
get(K key)
Parameter
Name
Description
key
K
Returns
Type
Description
V
Overrides
getComparator()
public Comparator<K> getComparator ()
Overrides
getMaxKey()
Returns
Type
Description
K
Overrides
getMinKey()
Returns
Type
Description
K
Overrides
getPredecessorKey(K key)
public K getPredecessorKey ( K key )
Parameter
Name
Description
key
K
Returns
Type
Description
K
Overrides
getSuccessorKey(K key)
public K getSuccessorKey ( K key )
Parameter
Name
Description
key
K
Returns
Type
Description
K
Overrides
inOrderTraversal(LLRBNode.NodeVisitor<K,V> visitor)
public void inOrderTraversal ( LLRBNode . NodeVisitor<K , V > visitor )
Overrides
indexOf(K key)
public int indexOf ( K key )
Parameter
Name
Description
key
K
Returns
Type
Description
int
Overrides
insert(K key, V value)
public ImmutableSortedMap<K , V > insert ( K key , V value )
Parameters
Name
Description
key
K
value
V
Overrides
isEmpty()
Overrides
iterator()
public Iterator<Map . Entry<K , V >> iterator ()
Overrides
iteratorFrom(K key)
public Iterator<Map . Entry<K , V >> iteratorFrom ( K key )
Parameter
Name
Description
key
K
Overrides
remove(K key)
public ImmutableSortedMap<K , V > remove ( K key )
Parameter
Name
Description
key
K
Overrides
reverseIterator()
public Iterator<Map . Entry<K , V >> reverseIterator ()
Overrides
reverseIteratorFrom(K key)
public Iterator<Map . Entry<K , V >> reverseIteratorFrom ( K key )
Parameter
Name
Description
key
K
Overrides
size()
Returns
Type
Description
int
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-06 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-06 UTC."],[],[]]