dw.util
Class SortedMap
Object
dw.util.Map
dw.util.SortedMap
A map that further guarantees that it will be in ascending key order, sorted according to the natural ordering of its keys, or by a comparator provided at sorted map creation time. This order is reflected when iterating over the sorted map's collection views (returned by the entrySet, keySet and values methods). Note that sorting by natural order is only supported for Number, String, Date, Money and Quantity as key.
Constructor Summary
SortedMap()
Constructor to create a new SortedMap.
SortedMap(comparator : Object)
Constructor to create a new SortedMap.
Method Summary
clone() : SortedMap
Returns a shallow copy of this map.
firstKey() : Object
Returns the first (lowest) key currently in this sorted map.
headMap(key : Object) : SortedMap
Returns a view of the portion of this map whose keys are strictly less than toKey.
lastKey() : Object
Returns the last (highest) key currently in this sorted map.
subMap(from : Object, to : Object) : SortedMap
Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.
tailMap(key : Object) : SortedMap
Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.

Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβ€”passing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβ€”this is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?

This isn't just another prep courseβ€”it's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.

The Salesforce B2C Commerce Architect certification is a whole different gameβ€”complex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Constructor Detail
SortedMap
public SortedMap()
Constructor to create a new SortedMap.

SortedMap
public SortedMap(comparator : Object)
Constructor to create a new SortedMap. The constructor takes a compare function as additional parameter. This comparator determines identity and the order of the element keys for this map. The order of the elements is determined with a comparator (see PropertyComparator) or with the help of the given function. The function must take two parameters and return a value <=-1 if the first parameter is smaller than the second, a value if >=1 if the first one is greater than the second parameter and a value in between like 0 if both are equal.
Parameters:
comparator - an instance of a PropertyComparator or a comparison function

Method Detail
clone
clone() : SortedMap
Returns a shallow copy of this map.
Returns:
a shallow copy of this map.

firstKey
firstKey() : Object
Returns the first (lowest) key currently in this sorted map.
Returns:
the first (lowest) key currently in this sorted map.

headMap
headMap(key : Object) : SortedMap
Returns a view of the portion of this map whose keys are strictly less than toKey.
Parameters:
key - high endpoint (exclusive) of the headMap.
Returns:
a view of the portion of this map whose keys are strictly less than toKey.

lastKey
lastKey() : Object
Returns the last (highest) key currently in this sorted map.
Returns:
the last (highest) key currently in this sorted map.

subMap
subMap(from : Object, to : Object) : SortedMap
Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. (If fromKey and toKey are equal, the returned sorted map is empty.)
Parameters:
from - low endpoint (inclusive) of the subMap.
to - high endpoint (exclusive) of the subMap.
Returns:
a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.

tailMap
tailMap(key : Object) : SortedMap
Returns a view of the portion of this map whose keys are greater than or equal to fromKey. The returned sorted map is backed by this map, so changes in the returned sorted map are reflected in this map, and vice-versa. The returned sorted map supports all optional map operations.
Parameters:
key - low endpoint (inclusive) of the tailMap.
Returns:
a view of the portion of this map whose keys are greater than or equal to fromKey.

β™₯
Notifications pending to read