Currently in the B4XCache class, the cache keys are decalred as Strings. This means that numbers don't sort properly when using B4XCache.Keys.Sort.
Could the keys be changed to be decalred as Object as they already are in B4XOrderedMap?
Example:
Private cache As B4XCache
Private b4xmap As B4XOrderedMap
b4xmap.Initialize
cache.Initialize
For Each i As Int In Array As Int(1, 362, 5, 99, 1234, 0)
cache.put(i, "")
b4xmap.Put(i, "")
Next
Log(cache.Keys)
cache.Keys.Sort(True)
Log(cache.Keys)
Log(b4xmap.Keys)
b4xmap.keys.Sort(True)
Log(b4xmap.Keys)
Ouputs:
(ArrayList) [1, 362, 5, 99, 1234, 0]
(ArrayList) [0, 1, 1234, 362, 5, 99]
(ArrayList) [1, 362, 5, 99, 1234, 0]
(ArrayList) [0, 1, 5, 99, 362, 1234]