Update: I found a related feature request in Trove on Sourceforge: http://sourceforge.net/tracker/index.php?func=detail&aid=1631704&group_id=39235&atid=424685
There doesn't seem to be a SortedSet so far, and the benefits of Trove seem to be less big here: it will save some memory for primitive types (and avoid boxing), but the algorithmic organization of the data will likely be the same, and it will still need entry objects.
Update #2:
For many use cases - depending on your write access patterns -, you should be able to get a decent performance by just using a TIntArrayList
and using the binarySearch
method for lookup (which assumes the array to be sorted!)
Inserting into a sorted array is O(n), so this is not an option when you perform a ton of modifications to the array, and query after each. But if your changes are bulk additions, just calling sort
after each update should give you a surprisingly good performance!