This library implements the java.util.TreeMap Class and some of it's popular methods using JavaScript. This library can be imported and used in your JavaScript projects, where you may need or want to use TreeMap<Key, Value>(). Learn more about java.util.TreeMap Class from here: https://www.tutorialspoint.com/java/util/java_util_treemap.htm
Just import/include the treeMpa.js file in your project and you are good to go.
Use something like this:
<html>
<script src = "treeMap.js"></script>
</html>
var myTreeMap = new TreeMap();
myTreeMap.put(1,"First Value");
myTreeMap.put(2,"Second Value");
myTreeMap.put(3,"Third Value");
myTreeMap.put(4,"Fourth Value");
- Value put(K key, V value)
- Value get(Object key)
- Key firstKey()
- Key lastKey()
- boolean containsKey(Object key)
- boolean containsValue(Object value)
- Value remove(Object key)
- void clear()
- Key floorKey(K key)
- Key ceilingKey(K key)
- Object clone()
- int size()
- Set keySet()
- void treeMap.foreach(V value)
- boolean isEmpty()