User documentation for javascript-collections-framework. Every export, with its signature,
cost and examples, is in the
API reference.
Pre-release: pages are added here as each collection ships.
Array, Map, Set, sorted arrays, shift queues, hand-written heaps and the Map LRU trick, each next to its collection, with what it costs and when to keep the native onedelete vs removeAt, set vs put, live and fail-fast iteration, identity equality, views, sort() ordercompareSymbol for your own typesCollection interface, live and fail-fast iteration, cursors, revision, printingkey option, equivalences, the equalsSymbol/hashCodeSymbol protocolrevision as a change signal, sending collections through JSON and workers, proxies, threads and awaitputAll from any map, native Set/Map interop, newSetFromMap for an LRU set or a set in a custom orderLists and ArrayList — indexed lists, insert vs add, sorting, list cursors, subList and reversed views, differences from Array
Sets and HashSet — a drop-in for Set with value equality on request (key, equivalence), structural equals, live iteration, cost and collision resistance, differences from Set
Linked hash sets and LinkedHashSet — a set in insertion order with both ends: getFirst/getLast, removeFirst/removeLast, addFirst/addLast that insert or move, a live reversed view, live iteration with moves, differences from Set
Maps and HashMap — a drop-in for Map with keys compared by value on request, getOrInsert, compute and merge, live key, entry and value views, structural equals, cost, differences from Map
Linked hash maps and LinkedHashMap — a map in insertion or access order with both ends: firstEntry/lastEntry, polls, putFirst/putLast that insert or move, a live reversed view, an LRU cache from accessOrder, maxSize and onEvict, live iteration with moves and accesses, differences from Map
Queues, deques and ArrayDeque — first in first out, stacks with push/pop, both ends, the reversed view, null rejection, differences from Array
LinkedList and node handles — a deque with O(1) insert and remove next to a known element, handles, stored null/undefined, differences from Array
Sorted maps and TreeMap — mappings kept in key order, nearest-entry queries (floorEntry, ceilingEntry, …), key-only queries through keySet(), live range and reversed views, entries as live handles, failures that change nothing, differences from Map
Sorted sets and TreeSet — members kept in order, nearest-match queries (floor, ceiling, …), live range and reversed views, comparator sameness, failures that change nothing, differences from a sorted array
Immutable lists, sets and maps — listOf, setOf, mapOf and the copyOf… factories, duplicates and null as in Set/Map, value-keyed copies, what immutable covers, views, equality with other collections, differences from Object.freeze
Unmodifiable views and lists over arrays — read-only windows that show the owner's changes (unmodifiableList, unmodifiableSortedMap, …), what they refuse, live entries, access order, equality and type checks; asList over an array: write-through, direct changes and their limits, frozen arrays, differences from Array
Algorithms — binary search and insertion points, reverse, rotate, seeded shuffle, swap, fill, min/max over any iterable, frequency, disjoint, sub-list search; iterators stay valid; differences from Array
Priority queues and PriorityQueue — least element first in O(log n), comparators, iteration is not sorted, ties, failures that change nothing, differences from a sorted array
Still to come: see the planned list in the README.