Skip to content

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>().

Notifications You must be signed in to change notification settings

somdipdey/JavaScript-implementation-of-java.util.TreeMap-Class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

JavaScript-implementation-of-java.util.TreeMap-Class

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

How to utilise TreeMap<Key, Value>() in your JavaScript projects

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>

Using TreeMap in you JavaScript projects

Initialise a TreeMap in your code like this:

 var myTreeMap = new TreeMap();

Adding new key, value to your TreeMap variable:

myTreeMap.put(1,"First Value");
myTreeMap.put(2,"Second Value");
myTreeMap.put(3,"Third Value");
myTreeMap.put(4,"Fourth Value");

List of methods of TreeMap Class implemented in this library:

  • 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()

About

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>().

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published